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,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;
}
}
}
}