Doc #61888 [Opn->Asn]: crypt() should be documented as not binary safe
Edit report at https://bugs.php.net/bug.php?id=61888&edit=1
ID: 61888
Updated by: girgias@php.net
Reported by: M8R-11ccwk at mailinator dot com
Summary: crypt() should be documented as not binary safe
-Status: Open
+Status: Assigned
Type: Documentation Problem
Package: Strings related
-PHP Version: 5.4.1
+PHP Version: Irrelevant
-Assigned To:
+Assigned To: girgias
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2012-05-01 13:10:54] M8R-11ccwk at mailinator dot com
Description:
------------
http://www.php.net/manual/en/function.crypt.php
I understand that crypt() must not be binary safe in order to maintain
compatibility with other implementations, but it should be clearly stated in the
crypt() documentation, since it might lead to unexpected results (for example,
when feeding raw bytes directly into crypt()).
Test script:
---------------
For example, this two lines generate the same output, which is correct, but can be confusing:
echo crypt("aaa", '$2a$07$usesomesillystringforsalt$');
echo crypt("aaa\x00aa", '$2a$07$usesomesillystringforsalt$');
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=61888&edit=1
Thread (4 messages)