From 61eb9913383505e15c74bfcb43c08ac508bcf1c7 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 19 Dec 2006 07:12:49 +0000 Subject: [PATCH] quitened these stupid php5.2 warnings: it seems stripos has the same problems as strstr and stristr, there for I changed everything to @stripos --- phpgwapi/inc/xajax.inc.php | 39 +++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/phpgwapi/inc/xajax.inc.php b/phpgwapi/inc/xajax.inc.php index bfff81b8ad..412c694e54 100644 --- a/phpgwapi/inc/xajax.inc.php +++ b/phpgwapi/inc/xajax.inc.php @@ -615,15 +615,15 @@ class xajax for ($i = 0; $i < sizeof($aArgs); $i++) { // If magic quotes is on, then we need to strip the slashes from the args - if (get_magic_quotes_gpc() == 1 && is_string($aArgs[$i])) { - + if (get_magic_quotes_gpc() == 1 && is_string($aArgs[$i])) + { $aArgs[$i] = stripslashes($aArgs[$i]); } - if (stristr($aArgs[$i],"") != false) + if (@stripos($aArgs[$i],"") !== false) { $aArgs[$i] = $this->_xmlToArray("xjxobj",$aArgs[$i]); } - else if (stristr($aArgs[$i],"") != false) + else if (@stripos($aArgs[$i],"") !== false) { $aArgs[$i] = $this->_xmlToArray("xjxquery",$aArgs[$i]); } @@ -1064,32 +1064,32 @@ class xajax if ($rootTag == "xjxobj") { - while(!stristr($this->aObjArray[$this->iPos],"")) + while(@stripos($this->aObjArray[$this->iPos],"") === false) { $this->iPos++; - if(stristr($this->aObjArray[$this->iPos],"")) + if(@stripos($this->aObjArray[$this->iPos],"") !== false) { $key = ""; $value = null; $this->iPos++; - while(!stristr($this->aObjArray[$this->iPos],"")) + while(@stripos($this->aObjArray[$this->iPos],"") === false) { - if(stristr($this->aObjArray[$this->iPos],"")) + if(@stripos($this->aObjArray[$this->iPos],"") !== false) { $this->iPos++; - while(!stristr($this->aObjArray[$this->iPos],"")) + while(@stripos($this->aObjArray[$this->iPos],"") === false) { $key .= $this->aObjArray[$this->iPos]; $this->iPos++; } } - if(stristr($this->aObjArray[$this->iPos],"")) + if(@stripos($this->aObjArray[$this->iPos],"") !== false) { $this->iPos++; - while(!stristr($this->aObjArray[$this->iPos],"")) + while(@stripos($this->aObjArray[$this->iPos],"") === false) { - if(stristr($this->aObjArray[$this->iPos],"")) + if(@stripos($this->aObjArray[$this->iPos],"") !== false) { $value = $this->_parseObjXml("xjxobj"); $this->iPos++; @@ -1117,9 +1117,9 @@ class xajax { $sQuery = ""; $this->iPos++; - while(!stristr($this->aObjArray[$this->iPos],"")) + while(@stripos($this->aObjArray[$this->iPos],"") === false) { - if (stristr($this->aObjArray[$this->iPos],"") || stristr($this->aObjArray[$this->iPos],"")) + if (@stripos($this->aObjArray[$this->iPos],"") !== false || @stripos($this->aObjArray[$this->iPos],"") !== false) { $this->iPos++; continue; @@ -1241,4 +1241,13 @@ function xajaxErrorHandler($errno, $errstr, $errfile, $errline) $GLOBALS['xajaxErrorHandlerText'] .= "\n----\n[$errTypeStr] $errstr\nerror in line $errline of file $errfile"; } -?> +if (!function_exists('stripos')) +{ + /** + * stripos for php < 5 + */ + function stripos($str,$needle,$offset=0) + { + return strpos(strtolower($str),strtolower($needle),$offset); + } +}