From: <tr...@us...> - 2012-12-10 19:59:54
|
Revision: 10351 http://sourceforge.net/p/xoops/svn/10351 Author: trabis Date: 2012-12-10 19:59:49 +0000 (Mon, 10 Dec 2012) Log Message: ----------- Fixing protector problems with the new lazy instantiation of database Modified Paths: -------------- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/logger/plugins/legacy/logger.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/include/precheck.inc.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/include/precheck_functions.php XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/preloads/core.php Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/logger/plugins/legacy/logger.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/logger/plugins/legacy/logger.php 2012-12-10 19:39:25 UTC (rev 10350) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/logger/plugins/legacy/logger.php 2012-12-10 19:59:49 UTC (rev 10351) @@ -52,10 +52,8 @@ { error_reporting(E_ALL | E_STRICT); $xoops = Xoops::getInstance(); - if (class_exists('XoopsDatabase', false)) { - if ($xoops->getModuleConfig('debug_mode', 'logger') == 2) { - $this->usePopup = true; - } + if ($xoops->getModuleConfig('debug_mode', 'logger') == 2) { + $this->usePopup = true; } $this->activated = true; $this->enableRendering(); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/include/precheck.inc.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/include/precheck.inc.php 2012-12-10 19:39:25 UTC (rev 10350) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/include/precheck.inc.php 2012-12-10 19:59:49 UTC (rev 10351) @@ -23,11 +23,6 @@ require_once dirname(__FILE__) . '/precheck_functions.php'; -if (class_exists('XoopsDatabase', false)) { - require dirname(__FILE__) . '/postcheck.inc.php'; - return; -} - define('PROTECTOR_PRECHECK_INCLUDED', 1); define('PROTECTOR_VERSION', file_get_contents(dirname(__FILE__) . '/version.txt')); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/include/precheck_functions.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/include/precheck_functions.php 2012-12-10 19:39:25 UTC (rev 10350) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/include/precheck_functions.php 2012-12-10 19:59:49 UTC (rev 10351) @@ -75,14 +75,6 @@ } } - // "DB Layer Trapper" - $force_override = strstr(@$_SERVER['REQUEST_URI'], 'protector/admin/index.php?page=advisory') ? true : false; - // $force_override = true ; - if ($force_override || !empty($conf['enable_dblayertrap'])) { - @define('PROTECTOR_ENABLED_ANTI_SQL_INJECTION', 1); - $protector->dblayertrap_init($force_override); - } - // "Big Umbrella" subset version if (!empty($conf['enable_bigumbrella'])) { @define('PROTECTOR_ENABLED_ANTI_XSS', 1); Modified: XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/preloads/core.php =================================================================== --- XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/preloads/core.php 2012-12-10 19:39:25 UTC (rev 10350) +++ XoopsCore/branches/2.6.x/2.6.0/htdocs/modules/protector/preloads/core.php 2012-12-10 19:59:49 UTC (rev 10351) @@ -33,6 +33,7 @@ { /** * @static + * * @param $args */ static function eventCoreIncludeCommonStart($args) @@ -43,6 +44,7 @@ /** * @static + * * @param $args */ static function eventCoreIncludeCommonEnd($args) @@ -53,10 +55,24 @@ /** * @static + * * @param $args */ static function eventCoreClassDatabaseDatabasefactoryConnection($args) { + // Protector class + require_once dirname(dirname(__FILE__)) . '/class/protector.php'; + + // Protector object + $protector = Protector::getInstance(); + $conf = $protector->getConf(); + // "DB Layer Trapper" + $force_override = strstr(@$_SERVER['REQUEST_URI'], 'protector/admin/index.php?page=advisory') ? true : false; + //$force_override = true ; + if ($force_override || !empty($conf['enable_dblayertrap'])) { + @define('PROTECTOR_ENABLED_ANTI_SQL_INJECTION', 1); + $protector->dblayertrap_init($force_override); + } if (defined('XOOPS_DB_ALTERNATIVE') && class_exists(XOOPS_DB_ALTERNATIVE)) { $args[0] = XOOPS_DB_ALTERNATIVE; } |