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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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)

Add a Patch

Pull Requests

Add a Pull Request

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.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sun Dec 08 16:01:24 2019 UTC