CleanTalk / phpbb3.1-3.2-antispam

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SpamFireWall to yes fails when DB is postgres

sletuffe opened this issue · comments

When trying to activate the SpamFireWall it fails with this error :

SQL ERROR [ postgres ]

ERREUR: erreur de syntaxe sur ou près de « ` » LINE 1: TRUNCATE TABLE `phpbb3_cleantalk_sfw` ^ []

SQL

TRUNCATE TABLE `phpbb3_cleantalk_sfw`

BACKTRACE

FILE: (not given by php)
LINE: (not given by php)
CALL: msg_handler()

FILE: [ROOT]/phpbb/db/driver/driver.php
LINE: 1023
CALL: trigger_error()

FILE: [ROOT]/phpbb/db/driver/postgres.php
LINE: 193
CALL: phpbb\db\driver\driver->sql_error()

FILE: [ROOT]/phpbb/db/driver/factory.php
LINE: 345
CALL: phpbb\db\driver\postgres->sql_query()

FILE: [ROOT]/ext/cleantalk/antispam/model/CleantalkSFW.php
LINE: 294
CALL: phpbb\db\driver\factory->sql_query()

FILE: [ROOT]/ext/cleantalk/antispam/model/main_model.php
LINE: 466
CALL: cleantalk\antispam\model\CleantalkSFW::sfw_update()

FILE: [ROOT]/ext/cleantalk/antispam/acp/main_module.php
LINE: 95
CALL: cleantalk\antispam\model\main_model::sfw_update()

FILE: [ROOT]/includes/functions_module.php
LINE: 676
CALL: cleantalk\antispam\acp\main_module->main()

FILE: [ROOT]/adm/index.php
LINE: 81
CALL: p_master->load_active()

I've removed the backquotes "`" around phpbb3_cleantalk_sfw which isn't postgres compatible on line :
https://github.com/CleanTalk/phpbb3.1-3.2-antispam/blob/master/cleantalk/antispam/model/CleantalkSFW.php#L294

And it seams to be fine.

I don't know for sure if phpBB allow spaces in table prefix, but it's unlikely, so that change should be safe for MySQL as well.
(or a properly escaped table name even better)

Thanks, fixed.