From e11b8e5e328b08f8142db3cc21de1b5d3670cd18 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 29 Apr 2007 14:25:19 +0000 Subject: [PATCH] worked around stupid php5.2 empty haystack warnings --- etemplate/inc/class.boetemplate.inc.php | 2 +- etemplate/inc/class.db_tools.inc.php | 2 +- etemplate/inc/class.so_sql.inc.php | 2 +- etemplate/inc/class.soetemplate.inc.php | 4 ++-- etemplate/inc/class.tab_widget.inc.php | 6 +++--- etemplate/inc/class.xmltool.inc.php | 8 ++++---- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/etemplate/inc/class.boetemplate.inc.php b/etemplate/inc/class.boetemplate.inc.php index 1eb654ac0f..161bb6ed06 100644 --- a/etemplate/inc/class.boetemplate.inc.php +++ b/etemplate/inc/class.boetemplate.inc.php @@ -210,7 +210,7 @@ } $Ok = False; $pat = $org_idx; - while (!$Ok && ($pat = @strstr($pat,'$'))) + while (!$Ok && ($pat = strpos($pat,'$') !== false)) { $pat = substr($pat,$pat[1] == '{' ? 2 : 1); diff --git a/etemplate/inc/class.db_tools.inc.php b/etemplate/inc/class.db_tools.inc.php index 03fb44553f..059bd296dc 100644 --- a/etemplate/inc/class.db_tools.inc.php +++ b/etemplate/inc/class.db_tools.inc.php @@ -769,7 +769,7 @@ } else // add the tables array { - if (strstr($fnew,'?>')) // remove a closeing tag + if (strpos($fnew,'?>') !== false) // remove a closeing tag { $fnew = str_replace('?>','',$fnew); } diff --git a/etemplate/inc/class.so_sql.inc.php b/etemplate/inc/class.so_sql.inc.php index a24d546929..90544887d9 100644 --- a/etemplate/inc/class.so_sql.inc.php +++ b/etemplate/inc/class.so_sql.inc.php @@ -328,7 +328,7 @@ class so_sql { foreach($query as $col => $val) { - if (is_int($col) || strstr($join,$col) === false) continue; + if (is_int($col) || strpos($join,$col) === false) continue; $query[] = $this->db->expression($this->table_name,$this->table_name.'.',array($col=>$val)); unset($query[$col]); } diff --git a/etemplate/inc/class.soetemplate.inc.php b/etemplate/inc/class.soetemplate.inc.php index b5ad42d0ef..fb45b7e90c 100644 --- a/etemplate/inc/class.soetemplate.inc.php +++ b/etemplate/inc/class.soetemplate.inc.php @@ -972,7 +972,7 @@ { if (($keys['name'] != $last['name'] || // write only newest version $keys['template'] != $last['template']) && - !strstr($keys['name'],'test')) + strpos($keys['name'],'test') === false) { $tpl->read($keys); $to_trans += $tpl->getToTranslate(); @@ -1340,7 +1340,7 @@ foreach($strings as $str) { if (strlen($str) > 1 && $str{0} != '@' && $str{0} != '$' && - strstr($str,'$row') === false && strstr($str,'$cont') === false) + strpos($str,'$row') === false && strpos($str,'$cont') === false) { $to_trans[trim(strtolower($str))] = $str; } diff --git a/etemplate/inc/class.tab_widget.inc.php b/etemplate/inc/class.tab_widget.inc.php index 7fd7867a2b..6f29c1acef 100644 --- a/etemplate/inc/class.tab_widget.inc.php +++ b/etemplate/inc/class.tab_widget.inc.php @@ -89,13 +89,13 @@ $tab_widget =& new etemplate('etemplate.tab_widget'); $tab_widget->no_onclick = true; - if ($value && !strstr($value,'.')) + if ($value && strpos($value,'.') === false) { $value = $tmpl->name . '.' . $value; } foreach($names as $k => $name) { - if (!strstr($name,'.')) + if (strpos($name,'.') === false) { $name = $names[$k] = $tmpl->name . '.' . $name; } @@ -112,7 +112,7 @@ foreach($names as $k => $name) { - if (!strstr($name,'.')) + if (strpos($name,'.') === false) { $name = $names[$k] = $tmpl->name . '.' . $name; } diff --git a/etemplate/inc/class.xmltool.inc.php b/etemplate/inc/class.xmltool.inc.php index ce02517491..e653ac815f 100644 --- a/etemplate/inc/class.xmltool.inc.php +++ b/etemplate/inc/class.xmltool.inc.php @@ -304,8 +304,8 @@ if($this->data_type != 'node') { - $found_at = strstr($this->data,'PHP_SERIALIZED_OBJECT&:'); - if($found_at != False) + $found_at = strpos($this->data,'PHP_SERIALIZED_OBJECT&:'); + if($found_at !== False) { return unserialize(str_replace ('PHP_SERIALIZED_OBJECT&:', '', $this->data)); } @@ -359,8 +359,8 @@ $retval['attributes'] = $this->attributes; if($this->data_type != 'node') { - $found_at = strstr($this->data,'PHP_SERIALIZED_OBJECT&:'); - if($found_at != False) + $found_at = strpos($this->data,'PHP_SERIALIZED_OBJECT&:'); + if($found_at !== False) { $retval['value'] = unserialize(str_replace ('PHP_SERIALIZED_OBJECT&:', '', $this->data)); }