Pixelpost Forum

Pixelpost Forum (http://www.pixelpost.org/forum/index.php)
-   Pixelpost Help (http://www.pixelpost.org/forum/forumdisplay.php?f=10)
-   -   enabling defensio stops other front_ addons (http://www.pixelpost.org/forum/showthread.php?t=9842)

robackja 11-14-2008 08:52 PM

enabling defensio stops other front_ addons
 
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

Figured out the issue!
 
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

PHP Code:

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

phpinfo() from my site
 
http://joeroback.com/info.php

in case you need that for anything.


All times are GMT. The time now is 08:04 PM.

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.