From: hickert Date: Thu, 11 Feb 2010 11:08:10 +0000 (+0000) Subject: Fixed class_filter.inc X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=720c2e1369ac7694dc1aea37bd0a4cef2351065a;p=gosa.git Fixed class_filter.inc -Updated regex to allow to search for numeric values, git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15610 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/include/class_filter.inc b/gosa-core/include/class_filter.inc index 51ffec05e..f44e39dcb 100644 --- a/gosa-core/include/class_filter.inc +++ b/gosa-core/include/class_filter.inc @@ -407,12 +407,13 @@ class filter { $e_unset= is_array($element['unset'])?"":$element['unset']; } + // Do not replace escaped \$ - This is required to be able to search for e.g. windows machines. if ($this->elementValues[$tag] == "") { - $e_unset= preg_replace('/([^\\\\])\$/', "\\1".normalizeLdap($this->elementValues[$tag]), $e_unset); + $e_unset= preg_replace('/([^\\\\])\$/', '${1}'.normalizeLdap($this->elementValues[$tag]), $e_unset); $e_unset= preg_replace('/\\\\\$/','$', $e_unset); $filter= preg_replace("/\\$$tag/", $e_unset, $filter); } else { - $e_set= preg_replace('/([^\\\\])\$/', "\\1".normalizeLdap($this->elementValues[$tag]), $e_set); + $e_set= preg_replace('/([^\\\\])\$/', '${1}'.normalizeLdap($this->elementValues[$tag]), $e_set); $e_set= preg_replace('/\\\\\$/','$', $e_set); $filter= preg_replace("/\\$$tag/", $e_set, $filter); }