From 865af57a9ac40a699177b0c5d727f6c3856b697a Mon Sep 17 00:00:00 2001 From: lamplis Date: Wed, 5 Oct 2016 21:35:03 +0200 Subject: [PATCH] php 5 compatibility changes php 5 compatibility changes --- .../com_menus/submit_content/submit_content.class.php | 2 +- administrator/components/com_users/admin.users.php | 2 +- administrator/index.php | 2 +- administrator/modules/mod_pathway.php | 3 ++- components/com_user/user.php | 2 +- includes/PEAR/PEAR.php | 6 +++--- includes/domit/xml_domit_lite_parser.php | 3 ++- includes/joomla.php | 2 +- includes/patTemplate/patTemplate.php | 2 +- includes/patTemplate/patTemplate/Dump/XUL.php | 2 +- includes/patTemplate/patTemplate/Function/Highlight.php | 2 +- includes/patTemplate/patTemplate/OutputFilter/BBCode.php | 2 +- includes/phpInputFilter/class.inputfilter.php | 4 ++-- 13 files changed, 18 insertions(+), 16 deletions(-) diff --git a/administrator/components/com_menus/submit_content/submit_content.class.php b/administrator/components/com_menus/submit_content/submit_content.class.php index 8b4b3bc..e32d451 100644 --- a/administrator/components/com_menus/submit_content/submit_content.class.php +++ b/administrator/components/com_menus/submit_content/submit_content.class.php @@ -66,7 +66,7 @@ function edit(&$uid, $menutype, $option) $lists['link'] = mosAdminMenus::Link($menu, $uid); // get params definitions - $params =& new mosParameters($menu->params, $mainframe->getPath('menu_xml', $menu->type), 'menu'); + $params =new mosParameters($menu->params, $mainframe->getPath('menu_xml', $menu->type), 'menu'); submit_content_menu_html::edit($menu, $lists, $params, $option); } diff --git a/administrator/components/com_users/admin.users.php b/administrator/components/com_users/admin.users.php index 9a82cea..efeaf1e 100644 --- a/administrator/components/com_users/admin.users.php +++ b/administrator/components/com_users/admin.users.php @@ -307,7 +307,7 @@ function editUser($uid = '0', $option = 'users') $lists['sendEmail'] = mosHTML::yesnoRadioList('sendEmail', 'class="inputbox" size="1"', $row->sendEmail); $file = $mainframe->getPath('com_xml', 'com_users'); - $params =& new mosUserParameters($row->params, $file, 'component'); + $params =new mosUserParameters($row->params, $file, 'component'); HTML_users::edituser($row, $contact, $lists, $option, $uid, $params); } diff --git a/administrator/index.php b/administrator/index.php index 002c593..aff60db 100644 --- a/administrator/index.php +++ b/administrator/index.php @@ -170,7 +170,7 @@ if ($_VERSION->SITE == 1 && @$mosConfig_admin_expired === '1') { $file = $mainframe->getPath('com_xml', 'com_users'); - $params =& new mosParameters($my->params, $file, 'component'); + $params =new mosParameters($my->params, $file, 'component'); $now = time(); diff --git a/administrator/modules/mod_pathway.php b/administrator/modules/mod_pathway.php index 54b44b6..0952b38 100644 --- a/administrator/modules/mod_pathway.php +++ b/administrator/modules/mod_pathway.php @@ -29,7 +29,8 @@ { $html .= " / "; // try to miss edit functions - if ($task != '' && !eregi('edit', $task)) + //if ($task != '' && !eregi('edit', $task)) + if ($task != '' && !preg_match('/edit/i', $task)) { $html .= "$option"; } diff --git a/components/com_user/user.php b/components/com_user/user.php index 33b3ed1..1645eac 100644 --- a/components/com_user/user.php +++ b/components/com_user/user.php @@ -88,7 +88,7 @@ function userEdit($option, $uid, $submitvalue) $row->username = trim($row->username); $file = $mainframe->getPath('com_xml', 'com_users'); - $params =& new mosUserParameters($row->params, $file, 'component'); + $params =new mosUserParameters($row->params, $file, 'component'); HTML_user::userEdit($row, $option, $submitvalue, $params); } diff --git a/includes/PEAR/PEAR.php b/includes/PEAR/PEAR.php index ecd4193..4204448 100644 --- a/includes/PEAR/PEAR.php +++ b/includes/PEAR/PEAR.php @@ -91,7 +91,7 @@ * destructor, use error_log(), syslog() or something similar. * * IMPORTANT! To use the emulated destructors you need to create the - * objects by reference: $obj =& new PEAR_child; + * objects by reference: $obj =new PEAR_child; * * @category pear * @package PEAR @@ -630,12 +630,12 @@ function &raiseError($message = null, } if ($skipmsg) { - $a = & new $ec($code, $mode, $options, $userinfo); + $a = new $ec($code, $mode, $options, $userinfo); return $a; } else { - $a = & new $ec($message, $code, $mode, $options, $userinfo); + $a = new $ec($message, $code, $mode, $options, $userinfo); return $a; } } diff --git a/includes/domit/xml_domit_lite_parser.php b/includes/domit/xml_domit_lite_parser.php index 0765024..471f624 100644 --- a/includes/domit/xml_domit_lite_parser.php +++ b/includes/domit/xml_domit_lite_parser.php @@ -2099,7 +2099,8 @@ function parse(&$myXMLDoc, $xmlText, $preserveCDATA = true) //seem to work consistently across versions of PHP and Expat if (!$this->xmlDoc->preserveWhitespace) { - $xmlText = eregi_replace('>' . "[[:space:]]+" . '<', '><', $xmlText); + //$xmlText = eregi_replace('>' . "[[:space:]]+" . '<', '><', $xmlText); + $xmlText = preg_replace('/>[[:space:]]+<', $xmlText); } $success = xml_parse($parser, $xmlText); diff --git a/includes/joomla.php b/includes/joomla.php index 18a28f3..387f337 100644 --- a/includes/joomla.php +++ b/includes/joomla.php @@ -1014,7 +1014,7 @@ function initSessionAdmin($option, $task) { $errorlevel = error_reporting(); error_reporting(0); - $params =& new mosParameters($my->params, $file, 'component'); + $params = new mosParameters($my->params, $file, 'component'); error_reporting($errorlevel); } diff --git a/includes/patTemplate/patTemplate.php b/includes/patTemplate/patTemplate.php index 5d42b12..964d5ab 100644 --- a/includes/patTemplate/patTemplate.php +++ b/includes/patTemplate/patTemplate.php @@ -1518,7 +1518,7 @@ function &loadModule($moduleType, $moduleName, $params = array(), $new = false) return patErrorManager::raiseError(PATTEMPLATE_ERROR_MODULE_NOT_FOUND, "Module file $moduleFile does not contain class $moduleClass."); } - $this->_modules[$moduleType][$sig] = & new $moduleClass; + $this->_modules[$moduleType][$sig] = new $moduleClass; if (method_exists($this->_modules[$moduleType][$sig], 'setTemplateReference')) { $this->_modules[$moduleType][$sig]->setTemplateReference($this); diff --git a/includes/patTemplate/patTemplate/Dump/XUL.php b/includes/patTemplate/patTemplate/Dump/XUL.php index fdf12f5..c3da089 100644 --- a/includes/patTemplate/patTemplate/Dump/XUL.php +++ b/includes/patTemplate/patTemplate/Dump/XUL.php @@ -219,7 +219,7 @@ function displayFooter() if ($_GET['mode'] == 'debug') { require_once 'XML/Beautifier.php'; - $fmt = & new XML_Beautifier(array('indent' => ' ')); + $fmt = new XML_Beautifier(array('indent' => ' ')); echo '
';
 			echo htmlspecialchars($fmt->formatString($this->_doc->serialize()));
 			echo '
'; diff --git a/includes/patTemplate/patTemplate/Function/Highlight.php b/includes/patTemplate/patTemplate/Function/Highlight.php index 75adf30..15233e8 100644 --- a/includes/patTemplate/patTemplate/Function/Highlight.php +++ b/includes/patTemplate/patTemplate/Function/Highlight.php @@ -57,7 +57,7 @@ function call($params, $content) $params['numbers'] = constant($params['numbers']); } - $renderer = & new Text_Highlighter_Renderer_HTML($params); + $renderer = new Text_Highlighter_Renderer_HTML($params); $highlighter = & Text_Highlighter::factory($type); $highlighter->setRenderer($renderer); return $highlighter->highlight(trim($content)); diff --git a/includes/patTemplate/patTemplate/OutputFilter/BBCode.php b/includes/patTemplate/patTemplate/OutputFilter/BBCode.php index 14b8977..d8c7121 100644 --- a/includes/patTemplate/patTemplate/OutputFilter/BBCode.php +++ b/includes/patTemplate/patTemplate/OutputFilter/BBCode.php @@ -103,7 +103,7 @@ function _prepare() return false; } - $this->BBCode = & new patBBCode(); + $this->BBCode = new patBBCode(); if (isset($this->_params['skinDir'])) $this->BBCode->setSkinDir($this->_params['skinDir']); diff --git a/includes/phpInputFilter/class.inputfilter.php b/includes/phpInputFilter/class.inputfilter.php index 8e8aa8a..5fdf4cf 100644 --- a/includes/phpInputFilter/class.inputfilter.php +++ b/includes/phpInputFilter/class.inputfilter.php @@ -475,9 +475,9 @@ function decode($source) // url decode $source = html_entity_decode($source, ENT_QUOTES, "ISO-8859-1"); // convert decimal - $source = preg_replace('/&#(\d+);/me', "chr(\\1)", $source); // decimal notation + $source = preg_replace_callback('/&#(\d+);/m',function($m) { return chr($m[1]); }, $source); // decimal notation // convert hex - $source = preg_replace('/&#x([a-f0-9]+);/mei', "chr(0x\\1)", $source); // hex notation + $source = preg_replace_callback('/&#x([a-f0-9]+);/mi',function($m) { return chr($m[1]); }, $source); // hex notation return $source; }