diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index 067688b33..fc7a580d2 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -342,7 +342,7 @@ class Context // Set global variables for backward compatibility. $GLOBALS['oContext'] = self::$_instance; $GLOBALS['__Context__'] = &self::$_tpl_vars; - $GLOBALS['_time_zone'] = self::$_instance->db_info->time_zone; + $GLOBALS['_time_zone'] = config('locale.default_timezone'); $GLOBALS['lang'] = &$lang; // set session handler @@ -357,7 +357,7 @@ class Context } // start session - $relax_key_checks = (self::$_get_vars->act === 'procFileUpload' && preg_match('/shockwave\s?flash/i', $_SERVER['HTTP_USER_AGENT'])); + $relax_key_checks = ((self::$_get_vars->act ?? null) === 'procFileUpload' && preg_match('/shockwave\s?flash/i', $_SERVER['HTTP_USER_AGENT'])); Rhymix\Framework\Session::checkSSO($site_module_info); Rhymix\Framework\Session::start(false, $relax_key_checks); @@ -1528,11 +1528,11 @@ class Context */ public static function getJSCallbackFunc() { - $js_callback_func = isset($_GET['xe_js_callback']) ? $_GET['xe_js_callback'] : $_POST['xe_js_callback']; + $js_callback_func = isset($_GET['xe_js_callback']) ? $_GET['xe_js_callback'] : ($_POST['xe_js_callback'] ?? null); if(!preg_match('/^[a-z0-9\.]+$/i', $js_callback_func)) { - unset($js_callback_func); + $js_callback_func = null; unset($_GET['xe_js_callback']); unset($_POST['xe_js_callback']); } @@ -1602,7 +1602,7 @@ class Context } // If the first argument is '', reset existing parameters. - if (strval($args_list[0]) === '') + if (!is_array($args_list[0]) && strval($args_list[0]) === '') { array_shift($args_list); $get_vars = array(); diff --git a/classes/extravar/Extravar.class.php b/classes/extravar/Extravar.class.php index a852cf342..67a0e9921 100644 --- a/classes/extravar/Extravar.class.php +++ b/classes/extravar/Extravar.class.php @@ -27,7 +27,7 @@ class ExtraVar * @param int $module_srl Sequence of module * @return ExtraVar */ - function &getInstance($module_srl) + public static function getInstance($module_srl) { return new ExtraVar($module_srl); } diff --git a/classes/mobile/Mobile.class.php b/classes/mobile/Mobile.class.php index bf3c8a645..0c71b2380 100644 --- a/classes/mobile/Mobile.class.php +++ b/classes/mobile/Mobile.class.php @@ -38,7 +38,7 @@ class Mobile } // Not mobile if disabled explicitly. - if (!self::isMobileEnabled() || Context::get('full_browse') || $_COOKIE["FullBrowse"]) + if (!self::isMobileEnabled() || Context::get('full_browse') || ($_COOKIE['FullBrowse'] ?? 0)) { return self::$_ismobile = false; } diff --git a/classes/module/ModuleHandler.class.php b/classes/module/ModuleHandler.class.php index b88af1a9e..9df159570 100644 --- a/classes/module/ModuleHandler.class.php +++ b/classes/module/ModuleHandler.class.php @@ -118,7 +118,7 @@ class ModuleHandler extends Handler $site_module_info = Context::get('site_module_info'); // Check unregistered domain action. - if (!$site_module_info || !isset($site_module_info->domain_srl) || $site_module_info->is_default_replaced) + if (!$site_module_info || !isset($site_module_info->domain_srl) || ($site_module_info->is_default_replaced ?? false)) { $site_module_info = ModuleModel::getDefaultDomainInfo(); if ($site_module_info) @@ -183,6 +183,10 @@ class ModuleHandler extends Handler return false; } } + else + { + $module_info = null; + } // Get module info from mid. if(!$module_info && $this->mid) @@ -373,7 +377,11 @@ class ModuleHandler extends Handler } } - if($this->module_info->use_mobile != "Y") + if(!isset($this->module_info->use_mobile)) + { + $this->module_info->use_mobile = 'N'; + } + if($this->module_info->use_mobile !== 'Y') { Mobile::setMobile(FALSE); } @@ -815,27 +823,27 @@ class ModuleHandler extends Handler */ protected static function _setInputErrorToContext() { - if($_SESSION['XE_VALIDATOR_ERROR'] && !Context::get('XE_VALIDATOR_ERROR')) + if(isset($_SESSION['XE_VALIDATOR_ERROR']) && $_SESSION['XE_VALIDATOR_ERROR'] && !Context::get('XE_VALIDATOR_ERROR')) { Context::set('XE_VALIDATOR_ERROR', $_SESSION['XE_VALIDATOR_ERROR']); } - if($_SESSION['XE_VALIDATOR_MESSAGE'] && !Context::get('XE_VALIDATOR_MESSAGE')) + if(isset($_SESSION['XE_VALIDATOR_MESSAGE']) && $_SESSION['XE_VALIDATOR_MESSAGE'] && !Context::get('XE_VALIDATOR_MESSAGE')) { Context::set('XE_VALIDATOR_MESSAGE', $_SESSION['XE_VALIDATOR_MESSAGE']); } - if($_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] && !Context::get('XE_VALIDATOR_MESSAGE_TYPE')) + if(isset($_SESSION['XE_VALIDATOR_MESSAGE_TYPE']) && $_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] && !Context::get('XE_VALIDATOR_MESSAGE_TYPE')) { Context::set('XE_VALIDATOR_MESSAGE_TYPE', $_SESSION['XE_VALIDATOR_MESSAGE_TYPE']); } - if($_SESSION['XE_VALIDATOR_RETURN_URL'] && !Context::get('XE_VALIDATOR_RETURN_URL')) + if(isset($_SESSION['XE_VALIDATOR_RETURN_URL']) && $_SESSION['XE_VALIDATOR_RETURN_URL'] && !Context::get('XE_VALIDATOR_RETURN_URL')) { Context::set('XE_VALIDATOR_RETURN_URL', $_SESSION['XE_VALIDATOR_RETURN_URL']); } - if($_SESSION['XE_VALIDATOR_ID'] && !Context::get('XE_VALIDATOR_ID')) + if(isset($_SESSION['XE_VALIDATOR_ID']) && $_SESSION['XE_VALIDATOR_ID'] && !Context::get('XE_VALIDATOR_ID')) { Context::set('XE_VALIDATOR_ID', $_SESSION['XE_VALIDATOR_ID']); } - if(countobj($_SESSION['INPUT_ERROR'])) + if(isset($_SESSION['INPUT_ERROR']) && countobj($_SESSION['INPUT_ERROR'])) { Context::set('INPUT_ERROR', $_SESSION['INPUT_ERROR']); } diff --git a/classes/module/ModuleObject.class.php b/classes/module/ModuleObject.class.php index 55f71ae11..3f2956269 100644 --- a/classes/module/ModuleObject.class.php +++ b/classes/module/ModuleObject.class.php @@ -196,11 +196,11 @@ class ModuleObject extends BaseObject { // Set default variables $this->mid = $module_info->mid; - $this->module_srl = $module_info->module_srl; + $this->module_srl = $module_info->module_srl ?? null; $this->module_info = $module_info; $this->origin_module_info = $module_info; $this->xml_info = $xml_info; - $this->skin_vars = $module_info->skin_vars; + $this->skin_vars = $module_info->skin_vars ?? null; $this->module_config = ModuleModel::getInstance()->getModuleConfig($this->module, $module_info->site_srl); // Set privileges(granted) information diff --git a/classes/security/Password.class.php b/classes/security/Password.class.php index 993314f87..a0012d048 100644 --- a/classes/security/Password.class.php +++ b/classes/security/Password.class.php @@ -8,85 +8,85 @@ class Password Rhymix\Framework\Password::addAlgorithm($name, $regexp, $callback); } - public function getSupportedAlgorithms() + public static function getSupportedAlgorithms() { return Rhymix\Framework\Password::getSupportedAlgorithms(); } - public function getBestAlgorithm() + public static function getBestAlgorithm() { return Rhymix\Framework\Password::getBestSupportedAlgorithm(); } - public function getCurrentlySelectedAlgorithm() + public static function getCurrentlySelectedAlgorithm() { return Rhymix\Framework\Password::getDefaultAlgorithm(); } - public function getWorkFactor() + public static function getWorkFactor() { return Rhymix\Framework\Password::getWorkFactor(); } - public function createHash($password, $algorithm = null) + public static function createHash($password, $algorithm = null) { return Rhymix\Framework\Password::hashPassword($password, $algorithm); } - public function checkPassword($password, $hash, $algorithm = null) + public static function checkPassword($password, $hash, $algorithm = null) { return Rhymix\Framework\Password::checkPassword($password, $hash, $algorithm); } - function checkAlgorithm($hash) + public static function checkAlgorithm($hash) { $algos = Rhymix\Framework\Password::checkAlgorithm($hash); return count($algos) ? $algos[0] : false; } - function checkWorkFactor($hash) + public static function checkWorkFactor($hash) { return Rhymix\Framework\Password::checkWorkFactor($hash); } - public function createSecureSalt($length, $format = 'hex') + public static function createSecureSalt($length, $format = 'hex') { return Rhymix\Framework\Security::getRandom($length, $format); } - public function createTemporaryPassword($length = 16) + public static function createTemporaryPassword($length = 16) { return Rhymix\Framework\Password::getRandomPassword($length); } - public function createSignature($string) + public static function createSignature($string) { return Rhymix\Framework\Security::createSignature($string); } - public function checkSignature($string, $signature) + public static function checkSignature($string, $signature) { return Rhymix\Framework\Security::verifySignature($string, $signature); } - public function getSecretKey() + public static function getSecretKey() { return config('crypto.authentication_key'); } - public function pbkdf2($password, $salt, $algorithm = 'sha256', $iterations = 8192, $length = 24) + public static function pbkdf2($password, $salt, $algorithm = 'sha256', $iterations = 8192, $length = 24) { $hash = Rhymix\Framework\Security::pbkdf2($password, $salt, $algorithm, $iterations, $length); $hash = explode(':', $hash); return base64_decode($hash[3]); } - public function bcrypt($password, $salt = null) + public static function bcrypt($password, $salt = null) { return Rhymix\Framework\Security::bcrypt($password, $salt); } - function strcmpConstantTime($a, $b) + public static function strcmpConstantTime($a, $b) { return Rhymix\Framework\Security::compareStrings($a, $b); } diff --git a/classes/validator/Validator.class.php b/classes/validator/Validator.class.php index 9b6a3768a..30a81d9c6 100644 --- a/classes/validator/Validator.class.php +++ b/classes/validator/Validator.class.php @@ -124,7 +124,7 @@ class Validator return FALSE; } - $parser = new XmlParser(); + $parser = new XeXmlParser(); $xml = $parser->loadXmlFile($xml_path); if(!isset($xml->ruleset) || !isset($xml->ruleset->fields) || !isset($xml->ruleset->fields->field)) { diff --git a/classes/xml/XmlJsFilter.class.php b/classes/xml/XmlJsFilter.class.php index 076504d71..ca723338b 100644 --- a/classes/xml/XmlJsFilter.class.php +++ b/classes/xml/XmlJsFilter.class.php @@ -46,7 +46,7 @@ * @package /classes/xml * @version 0.2 */ -class XmlJsFilter extends XmlParser +class XmlJsFilter extends XeXmlParser { /** diff --git a/classes/xml/XmlLangParser.class.php b/classes/xml/XmlLangParser.class.php index 935a0a4bc..3911bd8bb 100644 --- a/classes/xml/XmlLangParser.class.php +++ b/classes/xml/XmlLangParser.class.php @@ -8,7 +8,7 @@ * @package /classes/xml * @version 0.1 */ -class XmlLangParser extends XmlParser +class XmlLangParser extends XeXmlParser { /** diff --git a/classes/xml/XmlParser.class.php b/classes/xml/XmlParser.class.php index 327d0219f..90cb46ec4 100644 --- a/classes/xml/XmlParser.class.php +++ b/classes/xml/XmlParser.class.php @@ -35,7 +35,7 @@ class Xml_Node_ * @package /classes/xml * @version 0.1 */ -class XmlParser +class XeXmlParser { /** @@ -75,7 +75,7 @@ class XmlParser } $buff = FileHandler::readFile($filename); - $oXmlParser = new XmlParser(); + $oXmlParser = new self(); return $oXmlParser->parse($buff); } @@ -232,5 +232,14 @@ class XmlParser } } + +/** + * Alias to XmlParser for backward compatibility. + */ +if (!class_exists('XmlParser')) +{ + class_alias('XeXmlParser', 'XmlParser'); +} + /* End of file XmlParser.class.php */ /* Location: ./classes/xml/XmlParser.class.php */ diff --git a/common/autoload.php b/common/autoload.php index 9ab819280..3e4d8395a 100644 --- a/common/autoload.php +++ b/common/autoload.php @@ -83,6 +83,7 @@ $GLOBALS['RX_AUTOLOAD_FILE_MAP'] = array_change_key_case(array( 'XmlJsFilter' => 'classes/xml/XmlJsFilter.class.php', 'XmlLangParser' => 'classes/xml/XmlLangParser.class.php', 'XmlParser' => 'classes/xml/XmlParser.class.php', + 'XeXmlParser' => 'classes/xml/XmlParser.class.php', 'Bmp' => 'common/libraries/bmp.php', 'Ftp' => 'common/libraries/ftp.php', 'Tar' => 'common/libraries/tar.php', diff --git a/common/framework/db.php b/common/framework/db.php index b873761ff..812258bd3 100644 --- a/common/framework/db.php +++ b/common/framework/db.php @@ -836,6 +836,10 @@ class DB $dbtype = $matches[1]; $size = $matches[2]; } + else + { + $size = ''; + } $xetype = Parsers\DBTableParser::getXEType($dbtype, $size ?: ''); // Return the result as an object. diff --git a/common/framework/parsers/dbquery/query.php b/common/framework/parsers/dbquery/query.php index 63aa039d1..968924538 100644 --- a/common/framework/parsers/dbquery/query.php +++ b/common/framework/parsers/dbquery/query.php @@ -528,6 +528,8 @@ class Query extends VariableBase { return ''; } + $page = 0; + $offset = 0; // Get the offset from the page or offset variable. if ($navigation->page) diff --git a/common/framework/parsers/dbquery/variablebase.php b/common/framework/parsers/dbquery/variablebase.php index 7e37a2cc6..255fcc375 100644 --- a/common/framework/parsers/dbquery/variablebase.php +++ b/common/framework/parsers/dbquery/variablebase.php @@ -39,7 +39,7 @@ class VariableBase $value = '(' . $this->getQueryString($prefix, $args) . ')'; $params = $this->getQueryParams(); } - elseif ($this->var && Query::isValidVariable($args[$this->var], $this instanceof ColumnWrite)) + elseif ($this->var && Query::isValidVariable($args[$this->var] ?? null, $this instanceof ColumnWrite)) { if ($args[$this->var] instanceof EmptyString || $args[$this->var] instanceof NullValue) { @@ -285,7 +285,7 @@ class VariableBase */ public function getValue(array $args) { - if ($this->var && Query::isValidVariable($args[$this->var], $this instanceof ColumnWrite)) + if ($this->var && Query::isValidVariable($args[$this->var] ?? null, $this instanceof ColumnWrite)) { if ($args[$this->var] === '') { @@ -321,7 +321,7 @@ class VariableBase public function getDefaultValue() { // Get the current column name. - $column = $this instanceof ColumnWrite ? $this->name : $this->column; + $column = $this instanceof ColumnWrite ? $this->name : ($this->column ?? null); // If the default value is a column name, escape it. if (strpos($this->default, '.') !== false && Query::isValidColumnName($this->default)) @@ -382,7 +382,7 @@ class VariableBase // Don't apply a filter if there is no variable. $column = $this instanceof ColumnWrite ? $this->name : $this->column; $filter = isset($this->filter) ? $this->filter : ''; - if (strval($value) === '') + if (!is_array($value) && strval($value) === '') { $filter = ''; } diff --git a/common/framework/router.php b/common/framework/router.php index 714b15cea..e9cbd6564 100644 --- a/common/framework/router.php +++ b/common/framework/router.php @@ -146,7 +146,8 @@ class Router $prefix_type = 'mid'; // Find the module associated with this prefix. - $action_info = self::_getActionInfoByPrefix($prefix, $module_name = ''); + $module_name = ''; + $action_info = self::_getActionInfoByPrefix($prefix, $module_name); if ($action_info === false) { $action_info = self::_getActionInfoByModule($prefix); diff --git a/common/framework/session.php b/common/framework/session.php index faea96dfb..29e3e06da 100644 --- a/common/framework/session.php +++ b/common/framework/session.php @@ -963,7 +963,7 @@ class Session public static function getValidityInfo($member_srl) { $member_srl = intval($member_srl); - $validity_info = Cache::get(sprintf('session:validity_info:%d', $member_srl), $invalid_before); + $validity_info = Cache::get(sprintf('session:validity_info:%d', $member_srl)); if ($validity_info) { return $validity_info; diff --git a/common/functions.php b/common/functions.php index 71ac287ef..1d57290e3 100644 --- a/common/functions.php +++ b/common/functions.php @@ -34,7 +34,7 @@ function config($key, $value = null) */ function lang($code, $value = null) { - if (!$GLOBALS['lang'] instanceof Rhymix\Framework\Lang) + if (!isset($GLOBALS['lang']) || !$GLOBALS['lang'] instanceof Rhymix\Framework\Lang) { $GLOBALS['lang'] = Rhymix\Framework\Lang::getInstance(Context::getLangType() ?: config('locale.default_lang') ?: 'ko'); $GLOBALS['lang']->loadDirectory(RX_BASEDIR . 'common/lang', 'common'); @@ -554,7 +554,7 @@ function tobool($input) */ function countobj($array_or_object) { - if (is_array($array_or_object)) + if (is_array($array_or_object) || $array_or_object instanceof Countable) { return count($array_or_object); } @@ -564,7 +564,7 @@ function countobj($array_or_object) } else { - return @count($array_or_object); + return $array_or_object ? 1 : 0; } } diff --git a/common/tpl/common_layout.html b/common/tpl/common_layout.html index 105d6e083..fb514bf4b 100644 --- a/common/tpl/common_layout.html +++ b/common/tpl/common_layout.html @@ -30,10 +30,10 @@ - - - - + + + + @@ -52,7 +52,7 @@ var current_url = "{\Rhymix\Framework\URL::encodeIdna($current_url)}"; var request_uri = "{\Rhymix\Framework\URL::encodeIdna($request_uri)}"; var current_lang = xe.current_lang = "{$lang_type}"; - var current_mid = {json_encode($mid ?: null)}; + var current_mid = {json_encode((isset($mid) && $mid) ?: null)}; var http_port = {Context::get("_http_port") ?: 'null'}; var https_port = {Context::get("_https_port") ?: 'null'}; var enforce_ssl = {$site_module_info->security === 'always' ? 'true' : 'false'}; diff --git a/modules/addon/addon.admin.model.php b/modules/addon/addon.admin.model.php index 8cb1c21bc..e6f3d3eaa 100644 --- a/modules/addon/addon.admin.model.php +++ b/modules/addon/addon.admin.model.php @@ -169,7 +169,7 @@ class addonAdminModel extends addon return; } - $oXmlParser = new XmlParser(); + $oXmlParser = new XeXmlParser(); $tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file); $xml_obj = $tmp_xml_obj->addon; diff --git a/modules/addon/addon.controller.php b/modules/addon/addon.controller.php index a0af35735..c1ea14667 100644 --- a/modules/addon/addon.controller.php +++ b/modules/addon/addon.controller.php @@ -7,7 +7,8 @@ */ class addonController extends addon { - + public $addon_file_called = false; + /** * Initialization * diff --git a/modules/admin/admin.admin.model.php b/modules/admin/admin.admin.model.php index 65395c5c6..b758ee2d4 100644 --- a/modules/admin/admin.admin.model.php +++ b/modules/admin/admin.admin.model.php @@ -425,7 +425,7 @@ class adminAdminModel extends admin return; } - $oXmlParser = new XmlParser(); + $oXmlParser = new XeXmlParser(); $_xml_obj = $oXmlParser->loadXmlFile($info_file); if(!$_xml_obj->theme) { diff --git a/modules/admin/admin.admin.view.php b/modules/admin/admin.admin.view.php index 277000aee..64f66cfd9 100644 --- a/modules/admin/admin.admin.view.php +++ b/modules/admin/admin.admin.view.php @@ -113,7 +113,7 @@ class adminAdminView extends admin $params["act"] = "getResourceapiLastupdate"; $body = XmlGenerater::generate($params); $buff = FileHandler::getRemoteResource($config->download_server, $body, 3, "POST", "application/xml"); - $xml_lUpdate = new XmlParser(); + $xml_lUpdate = new XeXmlParser(); $lUpdateDoc = $xml_lUpdate->parse($buff); $updateDate = $lUpdateDoc->response->updatedate->body; @@ -224,7 +224,7 @@ class adminAdminView extends admin if(file_exists($cache_file)) { - $oXml = new XmlParser(); + $oXml = new XeXmlParser(); $buff = $oXml->parse(FileHandler::readFile($cache_file)); $item = $buff->zbxe_news->item; diff --git a/modules/autoinstall/autoinstall.admin.controller.php b/modules/autoinstall/autoinstall.admin.controller.php index 5d7104fd3..4c3ae535b 100644 --- a/modules/autoinstall/autoinstall.admin.controller.php +++ b/modules/autoinstall/autoinstall.admin.controller.php @@ -79,7 +79,7 @@ class autoinstallAdminController extends autoinstall $config = $oAdminModel->getAutoInstallAdminModuleConfig(); $buff = FileHandler::getRemoteResource($config->download_server, $body, 3, "POST", "application/xml", array(), array(), array(), $request_config); - $xml = new XmlParser(); + $xml = new XeXmlParser(); $xmlDoc = $xml->parse($buff); $this->updateCategory($xmlDoc); $this->updatePackages($xmlDoc); @@ -150,7 +150,7 @@ class autoinstallAdminController extends autoinstall continue; } - $xml = new XmlParser(); + $xml = new XeXmlParser(); $xmlDoc = $xml->loadXmlFile($real_path . $config_file); if(!$xmlDoc) diff --git a/modules/autoinstall/autoinstall.admin.model.php b/modules/autoinstall/autoinstall.admin.model.php index ce8793721..9a3d586f8 100644 --- a/modules/autoinstall/autoinstall.admin.model.php +++ b/modules/autoinstall/autoinstall.admin.model.php @@ -202,7 +202,7 @@ class autoinstallAdminModel extends autoinstall } $result = array(); - $xml = new XmlParser(); + $xml = new XeXmlParser(); foreach($output->data as $package) { $packageSrl = $package->package_srl; diff --git a/modules/autoinstall/autoinstall.admin.view.php b/modules/autoinstall/autoinstall.admin.view.php index 32455fc91..d2070f7f2 100644 --- a/modules/autoinstall/autoinstall.admin.view.php +++ b/modules/autoinstall/autoinstall.admin.view.php @@ -266,7 +266,7 @@ class autoinstallAdminView extends autoinstall continue; } - $xml = new XmlParser(); + $xml = new XeXmlParser(); $xmlDoc = $xml->loadXmlFile(FileHandler::getRealPath($path) . $config_file); if(!$xmlDoc) { @@ -336,7 +336,7 @@ class autoinstallAdminView extends autoinstall $config = $oAdminModel->getAutoInstallAdminModuleConfig(); $buff = FileHandler::getRemoteResource($config->download_server, $body, 3, "POST", "application/xml", array(), array(), array(), $request_config); - $xml_lUpdate = new XmlParser(); + $xml_lUpdate = new XeXmlParser(); $xmlDoc = $xml_lUpdate->parse($buff); if($xmlDoc && $xmlDoc->response->packagelist->item) { @@ -434,7 +434,7 @@ class autoinstallAdminView extends autoinstall $config = $oAdminModel->getAutoInstallAdminModuleConfig(); $buff = FileHandler::getRemoteResource($config->download_server, $body, 3, "POST", "application/xml", array(), array(), array(), $request_config); - $xml_lUpdate = new XmlParser(); + $xml_lUpdate = new XeXmlParser(); $lUpdateDoc = $xml_lUpdate->parse($buff); $updateDate = $lUpdateDoc->response->updatedate->body; @@ -590,7 +590,7 @@ class autoinstallAdminView extends autoinstall $config = $oAdminModel->getAutoInstallAdminModuleConfig(); $buff = FileHandler::getRemoteResource($config->download_server, $body, 3, "POST", "application/xml", array(), array(), array(), $request_config); - $xml_lUpdate = new XmlParser(); + $xml_lUpdate = new XeXmlParser(); $xmlDoc = $xml_lUpdate->parse($buff); if($xmlDoc && $xmlDoc->response->packagelist->item) { diff --git a/modules/autoinstall/autoinstall.class.php b/modules/autoinstall/autoinstall.class.php index 6f8cb8eb0..a0be8c99a 100644 --- a/modules/autoinstall/autoinstall.class.php +++ b/modules/autoinstall/autoinstall.class.php @@ -56,7 +56,7 @@ class XmlGenerater return; } - $xml = new XmlParser(); + $xml = new XeXmlParser(); $xmlDoc = $xml->parse($buff); return $xmlDoc; } diff --git a/modules/importer/importer.admin.controller.php b/modules/importer/importer.admin.controller.php index 112e50406..4c38b84f9 100644 --- a/modules/importer/importer.admin.controller.php +++ b/modules/importer/importer.admin.controller.php @@ -347,7 +347,7 @@ class importerAdminController extends importer { if(!$cur) $cur = 0; // Create the xmlParser object - $oXmlParser = new XmlParser(); + $oXmlParser = new XeXmlParser(); // Create objects for importing member information $this->oMemberController = getController('member'); $this->oMemberModel = getModel('member'); @@ -534,7 +534,7 @@ class importerAdminController extends importer { if(!$cur) $cur = 0; // Create the xmlParser object - $oXmlParser = new XmlParser(); + $oXmlParser = new XeXmlParser(); // Open an index file $f = fopen($index_file,"r"); // Pass if already read @@ -633,7 +633,7 @@ class importerAdminController extends importer function importModule($key, $cur, $index_file, $module_srl) { // Pre-create the objects needed - $this->oXmlParser = new XmlParser(); + $this->oXmlParser = new XeXmlParser(); // Get category information of the target module $oDocumentController = getController('document'); $oDocumentModel = getModel('document'); @@ -1245,7 +1245,7 @@ class importerAdminController extends importer if(!$buff) return array(); $buff = ''.$buff; - $oXmlParser = new XmlParser(); + $oXmlParser = new XeXmlParser(); $xmlDoc = $this->oXmlParser->parse($buff); if(!count($xmlDoc->extra_vars->key)) return array(); diff --git a/modules/importer/ttimport.class.php b/modules/importer/ttimport.class.php index 180b2939a..d6735e582 100644 --- a/modules/importer/ttimport.class.php +++ b/modules/importer/ttimport.class.php @@ -34,7 +34,7 @@ class ttimport function importModule($key, $cur, $index_file, $unit_count, $module_srl, $guestbook_module_srl, $user_id, $module_name=null) { // Pre-create the objects needed - $this->oXmlParser = new XmlParser(); + $this->oXmlParser = new XeXmlParser(); // Get category information of the target module $oDocumentController = getController('document'); $oDocumentModel = getModel('document'); diff --git a/modules/krzip/krzip.model.php b/modules/krzip/krzip.model.php index 9980f2bc3..743d456ec 100644 --- a/modules/krzip/krzip.model.php +++ b/modules/krzip/krzip.model.php @@ -160,7 +160,7 @@ class krzipModel extends krzip $request_config ); - $oXmlParser = new XmlParser(); + $oXmlParser = new XeXmlParser(); $result = $oXmlParser->parse($buff); if($result->error) { diff --git a/modules/layout/layout.model.php b/modules/layout/layout.model.php index 74e6090ce..25b0c45b7 100644 --- a/modules/layout/layout.model.php +++ b/modules/layout/layout.model.php @@ -529,7 +529,7 @@ class layoutModel extends layout return $layout_info; } // If no cache file exists, parse the xml and then return the variable. - $oXmlParser = new XmlParser(); + $oXmlParser = new XeXmlParser(); $tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file); if($tmp_xml_obj->layout) $xml_obj = $tmp_xml_obj->layout; diff --git a/modules/member/member.controller.php b/modules/member/member.controller.php index 5bf8612a8..eb57e0e97 100644 --- a/modules/member/member.controller.php +++ b/modules/member/member.controller.php @@ -3854,6 +3854,7 @@ class memberController extends member Rhymix\Framework\Cache::delete("member:member_groups:$member_srl:site:0"); Rhymix\Framework\Cache::delete("site_and_module:accessible_modules:$member_srl"); unset($GLOBALS['__member_info__'][$member_srl]); + unset($GLOBALS['__member_groups__'][$member_srl]); } } /* End of file member.controller.php */ diff --git a/modules/member/member.model.php b/modules/member/member.model.php index ea231b855..733b1617c 100644 --- a/modules/member/member.model.php +++ b/modules/member/member.model.php @@ -89,7 +89,7 @@ class memberModel extends member if(!$config->member_allow_fileupload) $config->member_allow_fileupload = 'N'; if(!$config->member_profile_view) $config->member_profile_view = 'N'; - if($config->redirect_mid) + if(isset($config->redirect_mid) && $config->redirect_mid) { $config->redirect_url = getNotEncodedFullUrl('','mid',$config->redirect_mid); } @@ -344,7 +344,7 @@ class memberModel extends member { if(!$member_srl) return new stdClass; - if(!$GLOBALS['__member_info__'][$member_srl]) + if(!isset($GLOBALS['__member_info__'][$member_srl])) { $cache_key = sprintf('member:member_info:%d', $member_srl); $GLOBALS['__member_info__'][$member_srl] = Rhymix\Framework\Cache::get($cache_key); @@ -385,7 +385,7 @@ class memberModel extends member */ public static function arrangeMemberInfo($info, $site_srl = 0) { - if(!$GLOBALS['__member_info__'][$info->member_srl]) + if(!isset($GLOBALS['__member_info__'][$info->member_srl])) { $config = self::getMemberConfig(); @@ -530,13 +530,11 @@ class memberModel extends member */ public static function getMemberGroups($member_srl, $site_srl = 0, $force_reload = false) { - static $member_groups = array(); - // cache controll $cache_key = sprintf('member:member_groups:%d:site:%d', $member_srl, $site_srl); $group_list = Rhymix\Framework\Cache::get($cache_key); - if(!$member_groups[$member_srl][$site_srl] || $force_reload) + if(!isset($GLOBALS['__member_groups__'][$member_srl]) || $force_reload) { if(!$group_list) { @@ -563,9 +561,9 @@ class memberModel extends member { $result[$group->group_srl] = $group->title; } - $member_groups[$member_srl][$site_srl] = $result; + $GLOBALS['__member_groups__'][$member_srl] = $result; } - return $member_groups[$member_srl][$site_srl]; + return $GLOBALS['__member_groups__'][$member_srl]; } /** @@ -637,7 +635,7 @@ class memberModel extends member */ public static function getGroups($site_srl = 0) { - if(!$GLOBALS['__group_info__'][$site_srl]) + if(!isset($GLOBALS['__group_info__'][$site_srl])) { $result = array(); diff --git a/modules/module/module.model.php b/modules/module/module.model.php index b573f35e7..4ecf9b003 100644 --- a/modules/module/module.model.php +++ b/modules/module/module.model.php @@ -255,6 +255,10 @@ class moduleModel extends module Rhymix\Framework\Cache::set('site_and_module:module_srl:' . $mid, $module_info->module_srl, 0, true); Rhymix\Framework\Cache::set('site_and_module:mid_info:' . $module_info->module_srl, $module_info, 0, true); } + else + { + return; + } } self::_applyDefaultSkin($module_info); @@ -517,7 +521,10 @@ class moduleModel extends module if(!$extra_vars[$val->module_srl] || !count(get_object_vars($extra_vars[$val->module_srl]))) continue; foreach($extra_vars[$val->module_srl] as $k => $v) { - if($target_module_info[$key]->{$k}) continue; + if(isset($target_module_info[$key]->{$k}) && $target_module_info[$key]->{$k}) + { + continue; + } $target_module_info[$key]->{$k} = $v; } } @@ -706,7 +713,7 @@ class moduleModel extends module */ public static function getTriggers($trigger_name, $called_position) { - if(is_null($GLOBALS['__triggers__'])) + if(!isset($GLOBALS['__triggers__'])) { $triggers = Rhymix\Framework\Cache::get('triggers'); if($triggers === null) @@ -726,7 +733,7 @@ class moduleModel extends module } } - return $GLOBALS['__triggers__'][$trigger_name][$called_position]; + return $GLOBALS['__triggers__'][$trigger_name][$called_position] ?? []; } /** @@ -893,7 +900,7 @@ class moduleModel extends module $skinInfos = $info->skin_infos; if(isset($skinInfos[$module]) && $skinInfos[$module]->is_theme) { - $themeSkinInfo = $GLOBALS['__ThemeModuleSkin__'][$module]['skins'][$skinInfos[$module]->name]; + $themeSkinInfo = $GLOBALS['__ThemeModuleSkin__'][$module]['skins'][$skinInfos[$module]->name] ?? null; $skin_list[$skinInfos[$module]->name] = $themeSkinInfo; } } @@ -942,7 +949,7 @@ class moduleModel extends module $skin_xml_file = sprintf("%s%s/%s/skin.xml", $path, $dir, $skin); if(!file_exists($skin_xml_file)) return; // Create XmlParser object - $oXmlParser = new XmlParser(); + $oXmlParser = new XeXmlParser(); $_xml_obj = $oXmlParser->loadXmlFile($skin_xml_file); // Return if no skin information is if(!$_xml_obj->skin) return; @@ -1871,10 +1878,13 @@ class moduleModel extends module $module_info->module = $module_info->module_srl = 0; } - $__cache = &$GLOBALS['__MODULE_GRANT__'][$module_info->module][intval($module_info->module_srl)][intval($member_info->member_srl)]; - if (is_object($__cache) && !$xml_info) + if (isset($GLOBALS['__MODULE_GRANT__'][$module_info->module][intval($module_info->module_srl ?? 0)][intval($member_info->member_srl)])) { - return $__cache; + $__cache = &$GLOBALS['__MODULE_GRANT__'][$module_info->module][intval($module_info->module_srl ?? 0)][intval($member_info->member_srl)]; + if (is_object($__cache) && !$xml_info) + { + return $__cache; + } } $grant = new stdClass; diff --git a/modules/widget/widget.controller.php b/modules/widget/widget.controller.php index 713ecdcc5..61411895a 100644 --- a/modules/widget/widget.controller.php +++ b/modules/widget/widget.controller.php @@ -275,7 +275,7 @@ class widgetController extends widget { $buff = trim($matches[0]); - $oXmlParser = new XmlParser(); + $oXmlParser = new XeXmlParser(); $xml_doc = $oXmlParser->parse(trim($buff)); if($xml_doc->img) $vars = $xml_doc->img->attrs; @@ -294,7 +294,7 @@ class widgetController extends widget function transWidgetBox($matches) { $buff = preg_replace('/
(.*)$/i','
',$matches[0]); - $oXmlParser = new XmlParser(); + $oXmlParser = new XeXmlParser(); $xml_doc = $oXmlParser->parse($buff); $vars = $xml_doc->div->attrs; @@ -317,7 +317,7 @@ class widgetController extends widget // Bringing widget cache sequence preg_match_all('!]*)widget=([^\>]*?)\>!is', $content, $matches); - $oXmlParser = new XmlParser(); + $oXmlParser = new XeXmlParser(); $cnt = count($matches[1]); for($i=0;$i<$cnt;$i++) diff --git a/modules/widget/widget.model.php b/modules/widget/widget.model.php index 574372627..b3c179e19 100644 --- a/modules/widget/widget.model.php +++ b/modules/widget/widget.model.php @@ -137,7 +137,7 @@ class widgetModel extends widget return $widget_info; } // If no cache file exists, parse the xml and then return the variable. - $oXmlParser = new XmlParser(); + $oXmlParser = new XeXmlParser(); $tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file); $xml_obj = $tmp_xml_obj->widget; if(!$xml_obj) return; @@ -207,6 +207,7 @@ class widgetModel extends widget $extra_var_count = count($extra_vars); $buff .= sprintf('$widget_info->extra_var_count = %d;', $extra_var_count); + $buff .= '$widget_info->extra_var = new stdClass;'; for($i=0;$i<$extra_var_count;$i++) { unset($var); @@ -279,7 +280,7 @@ class widgetModel extends widget return $widgetStyle_info; } // If no cache file exists, parse the xml and then return the variable. - $oXmlParser = new XmlParser(); + $oXmlParser = new XeXmlParser(); $tmp_xml_obj = $oXmlParser->loadXmlFile($xml_file); $xml_obj = $tmp_xml_obj->widgetstyle; if(!$xml_obj) return; diff --git a/vendor/leafo/lessphp/lessc.inc.php b/vendor/leafo/lessphp/lessc.inc.php index 2292f219d..a44b3f58d 100644 --- a/vendor/leafo/lessphp/lessc.inc.php +++ b/vendor/leafo/lessphp/lessc.inc.php @@ -746,7 +746,7 @@ class lessc { if ($suffix !== null && $subProp[0] == "assign" && is_string($subProp[1]) && - $subProp[1]{0} != $this->vPrefix) + $subProp[1][0] != $this->vPrefix) { $subProp[2] = array( 'list', ' ', @@ -1857,7 +1857,7 @@ class lessc { $this->pushEnv(); $parser = new lessc_parser($this, __METHOD__); foreach ($args as $name => $strValue) { - if ($name{0} != '@') $name = '@'.$name; + if ($name[0] != '@') $name = '@'.$name; $parser->count = 0; $parser->buffer = (string)$strValue; if (!$parser->propertyValue($value)) { @@ -2516,7 +2516,7 @@ class lessc_parser { $hidden = true; if (!isset($block->args)) { foreach ($block->tags as $tag) { - if (!is_string($tag) || $tag{0} != $this->lessc->mPrefix) { + if (!is_string($tag) || $tag[0] != $this->lessc->mPrefix) { $hidden = false; break; } @@ -2570,7 +2570,7 @@ class lessc_parser { protected function fixTags($tags) { // move @ tags out of variable namespace foreach ($tags as &$tag) { - if ($tag{0} == $this->lessc->vPrefix) + if ($tag[0] == $this->lessc->vPrefix) $tag[0] = $this->lessc->mPrefix; } return $tags; diff --git a/widgets/content/content.class.php b/widgets/content/content.class.php index d827e7337..a86e15ffb 100644 --- a/widgets/content/content.class.php +++ b/widgets/content/content.class.php @@ -496,7 +496,7 @@ class content extends WidgetHandler $buff = preg_replace("/<\?xml.*\?>/i", "", $buff); - $oXmlParser = new XmlParser(); + $oXmlParser = new XeXmlParser(); $xml_doc = $oXmlParser->parse($buff); if($xml_doc->rss) { diff --git a/widgets/mcontent/mcontent.class.php b/widgets/mcontent/mcontent.class.php index 896abbb07..e7e788083 100644 --- a/widgets/mcontent/mcontent.class.php +++ b/widgets/mcontent/mcontent.class.php @@ -416,7 +416,7 @@ class mcontent extends WidgetHandler $buff = preg_replace("/<\?xml.*\?>/i", "", $buff); - $oXmlParser = new XmlParser(); + $oXmlParser = new XeXmlParser(); $xml_doc = $oXmlParser->parse($buff); $rss = new stdClass(); if($xml_doc->rss)