Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 2.2.0

Bug #13238 Net_LDAP_LDIF problem with DOS LDIF files
Submitted: 2008-02-28 06:31 UTC
From: beni Assigned: beni
Status: Closed Package: Net_LDAP2
PHP Version: 5.2.4 OS:
Roadmaps: 2.0.0    
Subscription  


 [2008-02-28 06:31 UTC] beni (Benedikt Hallinger)
Description: ------------ Net_LDAP_LDIF::next_lines() does not handle dos-files correctly. If there are multiline comments and the file is a dos one, the comment mode does not work properly. With unix style line endings, all works fine.

Comments

 [2008-02-28 07:15 UTC] beni (Benedikt Hallinger)
To reproduce the bug: run "unix2dos" on tests/ldif_data/unsorted_w50.ldif and run "testRead_entry" test fo Net_LDAP_LDIFTest suite: CVS_current$ unix2dos tests/ldif_data/ CVS_current$ phpunit --verbose --filter 'testRead_entry' --coverage-html '/home/beni/public_html/Net_LDAP/coverage/' Net_LDAP_LDIFTest tests/Net_LDAP_LDIFTest.php This will fail with the following message: There was 1 failure: 1) testRead_entry(Net_LDAP_LDIFTest) Entries DNs not equal! (missing entry or wrong DN) Failed asserting that two arrays are equal. --- Expected +++ Actual @@ -1,4 +1,7 @@ Array ( - [0] => :cn=endspace,dc=cno + [0] => cn=test1,ou=example,dc=cno + [1] => cn=test blabla,ou=example,dc=cno + [2] => cn=test öäü,ou=example,dc=cno + [3] => :cn=endspace,dc=cno ) /usr/share/php/Net/Net_LDAP-CVS-200710091016/tests/Net_LDAP_LDIFTest.php:603 /usr/share/php/Net/Net_LDAP-CVS-200710091016/tests/Net_LDAP_LDIFTest.php:210
 [2008-02-28 07:17 UTC] beni (Benedikt Hallinger)
btw. i just have seen that the "Expectd" and "Actual" are swapped. I corrected this in CVS so it will report the correct identifier. It does look like: There was 1 failure: 1) testRead_entry(Net_LDAP_LDIFTest) Entries DNs not equal! (missing entry or wrong DN) Failed asserting that two arrays are equal. --- Expected +++ Actual @@ -1,7 +1,4 @@ Array ( - [0] => cn=test1,ou=example,dc=cno - [1] => cn=test blabla,ou=example,dc=cno - [2] => cn=test öäü,ou=example,dc=cno - [3] => :cn=endspace,dc=cno + [0] => :cn=endspace,dc=cno ) /usr/share/php/Net/Net_LDAP-CVS-200710091016/tests/Net_LDAP_LDIFTest.php:603 /usr/share/php/Net/Net_LDAP-CVS-200710091016/tests/Net_LDAP_LDIFTest.php:210
 [2008-02-28 07:40 UTC] beni (Benedikt Hallinger)
Setting php.ini value "auto_detect_line_endings" to ON does not help.
 [2008-03-05 07:02 UTC] beni (Benedikt Hallinger)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better. Thanks to cweiske for the patch