View Full Version : enabling defensio stops other front_ addons
robackja
11-14-2008, 08:52 PM
Enabled defensio for SPAM filtering. Then my PAGE_LOAD_TIME addon stopped working. Turns out, with defensio enabled, the 'frontpage_init' workspace doesn't seem to be executed. defensio uses the 'comment_added' workspace. code looks messy around the workspace stuff. any suggestions?
robackja
11-22-2008, 04:28 PM
Ok, figured out the issue. php variable $result is being used twice, although $result isn't declared global. $result is local in create_front_addon_array(), but the include_once() also happens within create_front_addon_array() context and thus conflict!!
includes/functions.php
function create_front_addon_array() {
...
$result = mysql_query();
while (...) {
include_once(...);
}
}
so here each front addon is 'included' in the PHP sense.
Defensio's front_defensio.php script does this on the first few lines:
$result = mysql_query("SELECT `status` FROM `{$pixelpost_db_prefix}addons` WHERE `addon_name` LIKE '%akismet%' and `type`='front'") or die(mysql_error());
$akismet = mysql_fetch_array($result);
...
If i change $result in front_defensio.php to some other var name, my other front admin addons get loaded. (PAGE_LOADTIME from pixelpost.org)
the mysql_fetch_arrays in create_front_addon_array() are getting interfered with defensio's akismet check query.
Dennis
11-22-2008, 04:34 PM
Can you check your settings concerning the register_global setting?
Thanks for reporting this, however, with register_global settings set to OFF this should pose no problem. Please confirm the setting is set to ON on your server.
robackja
11-22-2008, 04:39 PM
register_globals is definitely off (i even double checked), this bug is a tricky one...
notice the "include_once()" is inside create_front_addon_array function (which declares $result first), so when the include_once() happens, its within the scope of create_front_addon_array()
does that make sense?
robackja
11-22-2008, 04:42 PM
http://joeroback.com/info.php
in case you need that for anything.
vBulletin® v3.7.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.