From 2c7257e5e02afafdfd3a6c4457c6b87467f26eae Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 8 Jan 2010 09:15:49 +0000 Subject: [PATCH] Allow to escape '$' replacement in filters. - Enables to search for ((objectClass=sambaSamAccount)(cn=*$)) git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@15117 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_filter.inc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gosa-core/include/class_filter.inc b/gosa-core/include/class_filter.inc index 9b2fed545..6a6a4216e 100644 --- a/gosa-core/include/class_filter.inc +++ b/gosa-core/include/class_filter.inc @@ -400,10 +400,12 @@ class filter { } if ($this->elementValues[$tag] == "") { - $e_unset= preg_replace('/\$/', normalizeLdap($this->elementValues[$tag]), $e_unset); + $e_unset= preg_replace('/[^\\\\]\$/', normalizeLdap($this->elementValues[$tag]), $e_unset); + $e_unset= preg_replace('/\\\\\$/','$', $e_unset); $filter= preg_replace("/\\$$tag/", $e_unset, $filter); } else { - $e_set= preg_replace('/\$/', normalizeLdap($this->elementValues[$tag]), $e_set); + $e_set= preg_replace('/[^\\\\]\$/', normalizeLdap($this->elementValues[$tag]), $e_set); + $e_set= preg_replace('/\\\\\$/','$', $e_set); $filter= preg_replace("/\\$$tag/", $e_set, $filter); } } -- 2.30.2