Code

Fixed class_filter.inc
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 11 Feb 2010 11:08:10 +0000 (11:08 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Thu, 11 Feb 2010 11:08:10 +0000 (11:08 +0000)
-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

index 51ffec05ec18e0656f35b6d17a3a1a3ac4fa9e07..f44e39dcb5ec03c9cead94245d24390b19123e8b 100644 (file)
@@ -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);
         }