1
Here's one I did not expect to find.
I'm testing out a new site using Xoops 2.5.7.1 (PHP 5.4.27) and I have installed the Common Utilities (2.2.75) so that I can try out bitcero's QuickPages. The problem I have encountered comes when you try to hide the Common Utilities module from the Main Menu. In the protector's precheck.inc.php we find:
require_once dirname(__FILE__).'/precheck_functions.php' ;
if( class_exists( 'Database' ) ) {
require dirname(__FILE__).'/postcheck.inc.php' ;
return ; }
define('PROTECTOR_PRECHECK_INCLUDED' , 1 ) ;
When I hide other modules like User Profile, or Private Messaging, it does not appear that the Database class exists, so we turn on PROTECTOR_PRECHECK_INCLUDED, and proceed with the rest of the code in that file. When hiding Common Utilities, the Database class apparently exists, and we try to load the postcheck.inc.php file. Unfortunately this starts an infinite recursion because PROTECTOR_PRECHECK_INCLUDED has not yet been defined and we go back to loading precheck.inc.php.
If I change precheck.inc.php to move
define('PROTECTOR_PRECHECK_INCLUDED' , 1 ) ;
above the check for the Database class, this gets the flag set before we need it to prevent the resursion.