Changeset 1004407 in github
- Timestamp:
- Dec 23, 2009 9:09:36 AM (3 years ago)
- Branches:
- master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.6, release-0.7, release-0.8
- Children:
- 5e3d6c2
- Parents:
- aa16b4a
- Files:
-
- 2 edited
-
CHANGELOG (modified) (1 diff)
-
program/include/rcube_ldap.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
CHANGELOG
raa16b4a r1004407 2 2 =========================== 3 3 4 - Fix LDAP problem with special characters in RDN (#1486320) 4 5 - Improved handling of message parts of type message/rfc822 5 6 - Updated TinyMCE to 3.2.7 -
program/include/rcube_ldap.php
r0102742 r1004407 406 406 if ($this->conn && $dn) 407 407 { 408 $this->_debug("C: Read [dn: ".base64_decode($dn)."] [(objectclass=*)]"); 409 410 if ($this->ldap_result = @ldap_read($this->conn, base64_decode($dn), '(objectclass=*)', array_values($this->fieldmap))) 408 $dn = base64_decode($dn); 409 410 $this->_debug("C: Read [dn: $dn] [(objectclass=*)]"); 411 412 if ($this->ldap_result = @ldap_read($this->conn, $dn, '(objectclass=*)', array_values($this->fieldmap))) 411 413 $entry = ldap_first_entry($this->conn, $this->ldap_result); 412 414 else … … 420 422 421 423 // Add in the dn for the entry. 422 $rec['dn'] = base64_decode($dn);424 $rec['dn'] = $dn; 423 425 $res = $this->_ldap2result($rec); 424 426 $this->result = new rcube_result_set(1); … … 460 462 461 463 // Build the new entries DN. 462 $dn = $this->prop['LDAP_rdn'].'='.$newentry[$this->prop['LDAP_rdn']].','.$this->prop['base_dn']; 464 $dn = $this->prop['LDAP_rdn'].'='.rcube_ldap::quote_string($newentry[$this->prop['LDAP_rdn']], true) 465 .','.$this->prop['base_dn']; 463 466 464 467 $this->_debug("C: Add [dn: $dn]: ".print_r($newentry, true)); … … 533 536 // Handle RDN change 534 537 if ($replacedata[$this->prop['LDAP_rdn']]) { 535 $newdn = $this->prop['LDAP_rdn'].'='.$replacedata[$this->prop['LDAP_rdn']].','.$this->prop['base_dn']; 538 $newdn = $this->prop['LDAP_rdn'].'=' 539 .rcube_ldap::quote_string($replacedata[$this->prop['LDAP_rdn']], true) 540 .','.$this->prop['base_dn']; 536 541 if ($dn != $newdn) { 537 $newrdn = $this->prop['LDAP_rdn'].'='.$replacedata[$this->prop['LDAP_rdn']]; 542 $newrdn = $this->prop['LDAP_rdn'].'=' 543 .rcube_ldap::quote_string($replacedata[$this->prop['LDAP_rdn']], true); 538 544 unset($replacedata[$this->prop['LDAP_rdn']]); 539 545 } … … 693 699 * @static 694 700 */ 695 function quote_string($str) 696 { 697 return strtr($str, array('*'=>'\2a', '('=>'\28', ')'=>'\29', '\\'=>'\5c')); 701 function quote_string($str, $dn=false) 702 { 703 if ($dn) 704 $replace = array(','=>'\2c', '='=>'\3d', '+'=>'\2b', '<'=>'\3c', 705 '>'=>'\3e', ';'=>'\3b', '\\'=>'\5c', '"'=>'\22', '#'=>'\23'); 706 else 707 $replace = array('*'=>'\2a', '('=>'\28', ')'=>'\29', '\\'=>'\5c', 708 '/'=>'\2f'); 709 710 return strtr($str, $replace); 698 711 } 699 712
Note: See TracChangeset
for help on using the changeset viewer.
