php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #61888 crypt() should be documented as not binary safe
Submitted: 2012-05-01 13:10 UTC Modified: 2019-01-09 18:06 UTC
Votes:4
Avg. Score:3.5 ± 1.1
Reproduced:3 of 4 (75.0%)
Same Version:3 (100.0%)
Same OS:2 (66.7%)
From: M8R-11ccwk at mailinator dot com Assigned: girgias (profile)
Status: Closed Package: Strings related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: M8R-11ccwk at mailinator dot com
New email:
PHP Version: OS:

 

 [2012-05-01 13:10 UTC] 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$');


Patches

patch-crypt-not-binary-safe-warning (last revision 2019-01-01 21:01 UTC by girgias@php.net)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-12-01 14:28 UTC] cmb@php.net
-Type: Feature/Change Request +Type: Documentation Problem -Package: Documentation problem +Package: Strings related
 [2018-12-31 17:02 UTC] girgias@php.net
-Status: Open +Status: Assigned -PHP Version: 5.4.1 +PHP Version: Irrelevant -Assigned To: +Assigned To: girgias
 [2019-01-01 21:01 UTC] girgias@php.net
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
 [2019-01-09 18:00 UTC] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=346579
Log: Fix #61888: crypt() should be documented as not binary safe
 [2019-01-09 18:06 UTC] cmb@php.net
-Status: Assigned +Status: Closed
 [2019-01-09 18:06 UTC] cmb@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation better.
 [2020-02-07 06:05 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=82dfa0d98d06c0808cf2c0092d43cba23df3ed9e
Log: Fix #61888: crypt() should be documented as not binary safe
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 30 17:01:29 2024 UTC