protected static function _quoteRDN($attribute)
{
$rdn = $attribute[0] . '=';
// See if we need to quote the value.
if (preg_match('/^\\s|\\s$|\\s\\s|[,+="\\r\\n<>#;]/', $attribute[1])) {
$rdn .= '"' . str_replace('"', '\\"', $attribute[1]) . '"';
} else {
$rdn .= $attribute[1];
}
return $rdn;
}