fix for a PHP Warning: preg_split() [<a href='function.preg-split'>function.preg-split</a>]: 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
This commit is contained in:
Klaus Leithoff 2008-07-24 12:56:11 +00:00
parent 49897197c0
commit 832d65ab70

View File

@ -180,7 +180,9 @@ class egw_index implements IteratorAggregate
$keywords = array(); $keywords = array();
foreach($fields as $field) foreach($fields as $field)
{ {
foreach(preg_split(self::SEPERATORS,$field) as $keyword) $tmpArray = @preg_split(self::SEPERATORS,$field);
if (is_array($tmpArray)) {
foreach($tmpArray as $keyword)
{ {
if (!in_array($keyword,$keywords) && strlen($keyword) >= self::MIN_KEYWORD_LEN && !is_numeric($keyword)) if (!in_array($keyword,$keywords) && strlen($keyword) >= self::MIN_KEYWORD_LEN && !is_numeric($keyword))
{ {
@ -188,6 +190,7 @@ class egw_index implements IteratorAggregate
} }
} }
} }
}
// delete evtl. existing current keywords // delete evtl. existing current keywords
self::delete($app,$id); self::delete($app,$id);