Doc #61888 [PATCH]: crypt() should be documented as not binary safe
Edit report at https://bugs.php.net/bug.php?id=61888&edit=1
ID: 61888
Patch added by: girgias@php.net
Reported by: M8R-11ccwk at mailinator dot com
Summary: crypt() should be documented as not binary safe
Status: Assigned
Type: Documentation Problem
Package: Strings related
PHP Version: Irrelevant
Assigned To: girgias
Block user comment: N
Private report: N
New Comment:
The following patch has been added/updated:
Patch Name: patch-crypt-not-binary-safe-warning
Revision: 1546376474
URL: https://bugs.php.net/patch-display.php?bug=61888&patch=patch-crypt-not-binary-safe-warning&revision=1546376474
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)