From 832d65ab70d2aaadb80fb2a21076c05faa8b4b7a Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Thu, 24 Jul 2008 12:56:11 +0000 Subject: [PATCH] fix for a PHP Warning: preg_split() [function.preg-split]: Compilation failed: nothing to repeat at offset 14 in phpgwapi/inc/class.egw_index.inc.php on line 183 not sure why it occurs, but the fix works around it and seems not to break anything --- phpgwapi/inc/class.egw_index.inc.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/phpgwapi/inc/class.egw_index.inc.php b/phpgwapi/inc/class.egw_index.inc.php index bcbc1a3c87..44ac099663 100644 --- a/phpgwapi/inc/class.egw_index.inc.php +++ b/phpgwapi/inc/class.egw_index.inc.php @@ -180,11 +180,14 @@ class egw_index implements IteratorAggregate $keywords = array(); foreach($fields as $field) { - foreach(preg_split(self::SEPERATORS,$field) as $keyword) - { - if (!in_array($keyword,$keywords) && strlen($keyword) >= self::MIN_KEYWORD_LEN && !is_numeric($keyword)) + $tmpArray = @preg_split(self::SEPERATORS,$field); + if (is_array($tmpArray)) { + foreach($tmpArray as $keyword) { - $keywords[] = $keyword; + if (!in_array($keyword,$keywords) && strlen($keyword) >= self::MIN_KEYWORD_LEN && !is_numeric($keyword)) + { + $keywords[] = $keyword; + } } } }