Changeset ce53b67 in github


Ignore:
Timestamp:
Oct 12, 2011 5:10:05 AM (21 months ago)
Author:
thomascube <thomas@…>
Branches:
master, HEAD, courier-fix, dev-browser-capabilities, pdo, release-0.7, release-0.8
Children:
4b09fb6
Parents:
b35a0f1
Message:

Fix BER encoding of records-per-page parameter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • program/include/rcube_ldap.php

    rb35a0f1 rce53b67  
    11711171 
    11721172        $this->_debug("C: set controls sort=" . join(' ', unpack('H'.(strlen($sort_ctrl['value'])*2), $sort_ctrl['value'])) . " ({$this->sort_col});" 
    1173             . " vlv=" . join(' ', (unpack('H'.(strlen($vlv_ctrl['value'])*2), $vlv_ctrl['value']))) . " ($offset)"); 
     1173            . " vlv=" . join(' ', (unpack('H'.(strlen($vlv_ctrl['value'])*2), $vlv_ctrl['value']))) . " ($offset/$this->page_size)"); 
    11741174 
    11751175        if (!ldap_set_option($this->conn, LDAP_OPT_SERVER_CONTROLS, array($sort_ctrl, $vlv_ctrl))) { 
     
    16621662        # the code behind this string is broken down as follows: 
    16631663        # 30 = ber sequence with a length of 0e (14) bytes following 
    1664         # 20 = type integer (in two's complement form) with 2 bytes following (beforeCount): 01 00 (ie 0) 
    1665         # 20 = type integer (in two's complement form) with 2 bytes following (afterCount):  01 18 (ie 25-1=24) 
     1664        # 02 = type integer (in two's complement form) with 2 bytes following (beforeCount): 01 00 (ie 0) 
     1665        # 02 = type integer (in two's complement form) with 2 bytes following (afterCount):  01 18 (ie 25-1=24) 
    16661666        # a0 = type context-specific/constructed with a length of 06 (6) bytes following 
    1667         # 20 = type integer with 2 bytes following (offset): 01 01 (ie 1) 
    1668         # 20 = type integer with 2 bytes following (contentCount):  01 00 
     1667        # 02 = type integer with 2 bytes following (offset): 01 01 (ie 1) 
     1668        # 02 = type integer with 2 bytes following (contentCount):  01 00 
    16691669        # the following info was taken from the ISO/IEC 8825-1:2003 x.690 standard re: the 
    16701670        # encoding of integer values (note: these values are in 
     
    16891689 
    16901690        // now tack on records per page 
    1691         $str = sprintf("0201000201%02x", min(255, $rpp)-1) . $str; 
     1691        $str = "020100" . self::_ber_addseq(self::_ber_encode_int($rpp-1), '02') . $str; 
    16921692 
    16931693        // now tack on sequence identifier and length 
Note: See TracChangeset for help on using the changeset viewer.