cvs: pear /Net_LDAP2/LDAP2 LDIF.php
| From: | Benedikt Hallinger | Date: | Tue, 07 Apr 2009 05:29:18 +0000 |
| Subject: | cvs: pear /Net_LDAP2/LDAP2 LDIF.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-55893@lists.php.net to get a copy of this message | ||
beni Tue Apr 7 05:29:18 2009 UTC
Modified files:
/pear/Net_LDAP2/LDAP2 LDIF.php
Log:
* raw mode implemented in LDIF writing
http://cvs.php.net/viewvc.cgi/pear/Net_LDAP2/LDAP2/LDIF.php?r1=1.4&r2=1.5&diff_format=u
Index: pear/Net_LDAP2/LDAP2/LDIF.php
diff -u pear/Net_LDAP2/LDAP2/LDIF.php:1.4 pear/Net_LDAP2/LDAP2/LDIF.php:1.5
--- pear/Net_LDAP2/LDAP2/LDIF.php:1.4 Mon Apr 6 14:29:12 2009
+++ pear/Net_LDAP2/LDAP2/LDIF.php Tue Apr 7 05:29:18 2009
@@ -42,7 +42,7 @@
* @package Net_LDAP2
* @author Benedikt Hallinger <beni@php.net>
* @license http://www.gnu.org/copyleft/lesser.html LGPL
-* @version CVS: $Id: LDIF.php,v 1.4 2009/04/06 14:29:12 beni Exp $
+* @version CVS: $Id: LDIF.php,v 1.5 2009/04/07 05:29:18 beni Exp $
* @link http://pear.php.net/package/Net_LDAP22/
* @see http://www.ietf.org/rfc/rfc2849.txt
* @todo Error handling should be PEARified
@@ -192,7 +192,7 @@
* Number of columns where output line wrapping shall occur.
* Default is 78. Setting it to 40 or lower inhibits wrapping.
*
- * [NOT IMPLEMENTED] raw => REGEX
+ * raw => REGEX
* Use REGEX to denote the names of attributes that are to be
* considered binary in search results if writing entries.
* Example: raw => "/(?i:^jpegPhoto|;binary)/i"
@@ -750,7 +750,8 @@
}
// If converting is needed, do it
- if ($base64 && !($this->_options['raw'] &&
preg_match($this->_options['raw'], $attr_name))) {
+ // Either we have some special chars or a matching "raw" regex
+ if ($base64 || ($this->_options['raw'] &&
preg_match($this->_options['raw'], $attr_name))) {
$attr_name .= ':';
$attr_value = base64_encode($attr_value);
}