From 720c2e1369ac7694dc1aea37bd0a4cef2351065a Mon Sep 17 00:00:00 2001 From: hickert Date: Thu, 11 Feb 2010 11:08:10 +0000 Subject: [PATCH] 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 --- gosa-core/include/class_filter.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); } -- 2.30.2