From 27d12c0ab684d52dbe087f2c858d691acfe35f87 Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 18 Jan 2019 14:07:59 -0800 Subject: [PATCH] PHP7 fixes --- e107_handlers/xml_class.php | 11 +++++++++-- e107_plugins/linkwords/e_tohtml.php | 12 +++++++++--- e107_plugins/login_menu/login_menu_shortcodes.php | 4 ++-- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/e107_handlers/xml_class.php b/e107_handlers/xml_class.php index 9d052fdcf..df5b6b823 100644 --- a/e107_handlers/xml_class.php +++ b/e107_handlers/xml_class.php @@ -452,7 +452,7 @@ class xmlClass * * @param string $xml [optional] * @param boolean $simple [optional] false - use xml2array(), true - use xml_convert_to_array() - * @return string + * @return array|string */ function parseXml($xmlData = '', $simple = true) { @@ -478,7 +478,14 @@ class xmlClass ); $xmlData = str_replace(array_keys($extendedTypes), array_values($extendedTypes), $xmlData); - + + if(strpos($xmlData,'errors = $this->getErrors($xmlData); diff --git a/e107_plugins/linkwords/e_tohtml.php b/e107_plugins/linkwords/e_tohtml.php index 23d83e355..4ee1b09a4 100755 --- a/e107_plugins/linkwords/e_tohtml.php +++ b/e107_plugins/linkwords/e_tohtml.php @@ -200,9 +200,15 @@ class e_tohtml_linkwords if(is_string($this->area_opts)) { $this->area_opts = e107::unserialize($this->area_opts); - } - - if (!$this->lw_enabled || !count($this->area_opts) || !array_key_exists($area,$this->area_opts) || !$this->area_opts[$area]) return $text; // No linkwords in disabled areas + } + + if($this->area_opts === null) + { + $this->area_opts = array(); + } + + + if (!$this->lw_enabled || empty($this->area_opts) || !array_key_exists($area,$this->area_opts) || !$this->area_opts[$area]) return $text; // No linkwords in disabled areas // Split up by HTML tags and process the odd bits here $ptext = ""; diff --git a/e107_plugins/login_menu/login_menu_shortcodes.php b/e107_plugins/login_menu/login_menu_shortcodes.php index 909d10139..941510a13 100755 --- a/e107_plugins/login_menu/login_menu_shortcodes.php +++ b/e107_plugins/login_menu/login_menu_shortcodes.php @@ -92,11 +92,11 @@ e107::getLanguage()->bcDefs($bcDefs); $mode = varset($parm['mode']); - if($mode === 'usersettings' && e_PAGE === 'usersettings.php') + if($mode === 'usersettings' && defset('e_PAGE') === 'usersettings.php') { return 'active'; } - elseif($mode === 'profile' && e_PAGE === 'user.php') + elseif($mode === 'profile' && defset('e_PAGE') === 'user.php') { return 'active'; }