Skip to content

Commit

Permalink
[jan] Fix compatibility with PHP 5.3 (Bug #11888).
Browse files Browse the repository at this point in the history
  • Loading branch information
yunosh committed Jun 13, 2014
1 parent d687c78 commit 66d8170
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 17 deletions.
40 changes: 23 additions & 17 deletions framework/Ldap/lib/Horde/Ldap.php
Expand Up @@ -1546,23 +1546,29 @@ public static function quote($clause)
*/
public static function quoteDN($parts)
{
return implode(
',',
array_map(
function($attribute)
{
if (is_array($attribute[0])) {
return implode(
'+',
array_map('self::_quoteRDN', $attribute)
);
} else {
return self::_quoteRDN($attribute);
}
},
$parts
)
);
return implode(',', array_map('self::_quoteRDNs', $parts));
}

/**
* Takes a single or a list of RDN arrays with an attribute name and value
* and properly quotes it according to RFC 1485.
*
* @param array $attribute A tuple or array of tuples containing the
* attribute name and that attribute's value which
* make up the RDN.
*
* @return string The properly quoted string RDN.
*/
protected static function _quoteRDNs($attribute)
{
if (is_array($attribute[0])) {
return implode(
'+',
array_map('self::_quoteRDN', $attribute)
);
} else {
return self::_quoteRDN($attribute);
}
}

/**
Expand Down
2 changes: 2 additions & 0 deletions framework/Ldap/package.xml
Expand Up @@ -28,6 +28,7 @@
</stability>
<license uri="http://opensource.org/licenses/lgpl-3.0.html">LGPL-3.0</license>
<notes>
* [jan] Fix compatibility with PHP 5.3 (Bug #11888).
* [jan] Allow to specify base DN for searching user DNs.
</notes>
<contents>
Expand Down Expand Up @@ -456,6 +457,7 @@
<date>2014-06-11</date>
<license uri="http://opensource.org/licenses/lgpl-3.0.html">LGPL-3.0</license>
<notes>
* [jan] Fix compatibility with PHP 5.3 (Bug #11888).
* [jan] Allow to specify base DN for searching user DNs.
</notes>
</release>
Expand Down

0 comments on commit 66d8170

Please sign in to comment.