A RDN can contain multiple values, spearated by a plus sign. This method
returns each separate ocl=value pair of the RDN part.
If no multivalued RDN is detected, an array containing only the original
RDN part is returned.
For example, the multivalued RDN 'OU=Sales+CN=J. Smith' is exploded to:
array([0] => 'OU=Sales', [1] => 'CN=J. Smith')
The method tries to be smart if it encounters unescaped "+" characters,
but may fail, so better ensure escaped "+" in attribute names and
values.
[BUG] If you have a multivalued RDN with unescaped plus characters and
there is a unescaped plus sign at the end of an value followed by
an attribute name containing an unescaped plus, then you will get
wrong splitting:
$rdn = 'OU=Sales+C+N=J. Smith';
returns:
array('OU=Sales+C', 'N=J. Smith');
The "C+" is treaten as the value of the first pair instead of as
the attribute name of the second pair. To prevent this, escape
correctly.
public static splitRDNMultivalue ( string $rdn ) : array | ||
$rdn | string | Part of a (multivalued) escaped RDN (e.g. ou=foo or ou=foo+cn=bar) |
return | array | The components of the multivalued RDN. |