SF Bug #3036033 - Error if CN begins with a % sign

This commit is contained in:
Deon George
2011-04-29 12:08:38 +10:00
parent 2ea1fc6314
commit a35298e7f3
11 changed files with 57 additions and 29 deletions

View File

@@ -195,6 +195,14 @@ class Query extends xmlTemplate {
return $this->dn;
}
public function getDNEncode($url=true) {
// @todo Be nice to do all this in 1 location
if ($url)
return urlencode(preg_replace('/%([0-9a-fA-F]+)/',"%25\\1",$this->dn));
else
return preg_replace('/%([0-9a-fA-F]+)/',"%25\\1",$this->dn);
}
public function getAttrSortOrder() {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',5,0,__FILE__,__LINE__,__METHOD__,$fargs);