mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 13:47:31 +02:00
PHP7 fixes
This commit is contained in:
@@ -452,7 +452,7 @@ class xmlClass
|
|||||||
*
|
*
|
||||||
* @param string $xml [optional]
|
* @param string $xml [optional]
|
||||||
* @param boolean $simple [optional] false - use xml2array(), true - use xml_convert_to_array()
|
* @param boolean $simple [optional] false - use xml2array(), true - use xml_convert_to_array()
|
||||||
* @return string
|
* @return array|string
|
||||||
*/
|
*/
|
||||||
function parseXml($xmlData = '', $simple = true)
|
function parseXml($xmlData = '', $simple = true)
|
||||||
{
|
{
|
||||||
@@ -479,6 +479,13 @@ class xmlClass
|
|||||||
|
|
||||||
$xmlData = str_replace(array_keys($extendedTypes), array_values($extendedTypes), $xmlData);
|
$xmlData = str_replace(array_keys($extendedTypes), array_values($extendedTypes), $xmlData);
|
||||||
|
|
||||||
|
if(strpos($xmlData,'<html lang=')!==false)
|
||||||
|
{
|
||||||
|
$this->errors = "HTML cannot be parsed as XML";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if(!$xml = simplexml_load_string($xmlData, 'SimpleXMLElement', LIBXML_NOCDATA))
|
if(!$xml = simplexml_load_string($xmlData, 'SimpleXMLElement', LIBXML_NOCDATA))
|
||||||
{
|
{
|
||||||
$this->errors = $this->getErrors($xmlData);
|
$this->errors = $this->getErrors($xmlData);
|
||||||
|
@@ -202,7 +202,13 @@ class e_tohtml_linkwords
|
|||||||
$this->area_opts = e107::unserialize($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
|
// Split up by HTML tags and process the odd bits here
|
||||||
$ptext = "";
|
$ptext = "";
|
||||||
|
@@ -92,11 +92,11 @@ e107::getLanguage()->bcDefs($bcDefs);
|
|||||||
|
|
||||||
$mode = varset($parm['mode']);
|
$mode = varset($parm['mode']);
|
||||||
|
|
||||||
if($mode === 'usersettings' && e_PAGE === 'usersettings.php')
|
if($mode === 'usersettings' && defset('e_PAGE') === 'usersettings.php')
|
||||||
{
|
{
|
||||||
return 'active';
|
return 'active';
|
||||||
}
|
}
|
||||||
elseif($mode === 'profile' && e_PAGE === 'user.php')
|
elseif($mode === 'profile' && defset('e_PAGE') === 'user.php')
|
||||||
{
|
{
|
||||||
return 'active';
|
return 'active';
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user