From: hickert Date: Fri, 8 Jan 2010 09:15:49 +0000 (+0000) Subject: Allow to escape '$' replacement in filters. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2c7257e5e02afafdfd3a6c4457c6b87467f26eae;p=gosa.git 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 --- 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); } }