#34908 [Opn->Csd]: uniqid() produces too long strings on cygwin
| From: | iliaa@php.net | Date: | Thu, 20 Oct 2005 14:43:26 +0000 |
| Subject: | #34908 [Opn->Csd]: uniqid() produces too long strings on cygwin | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-86811@lists.php.net to get a copy of this message | ||
ID: 34908
Updated by: iliaa@php.net
Reported By: nohn@php.net
-Status: Open
+Status: Closed
Bug Type: Strings related
Operating System: Cygwin
PHP Version: 5.1.0RC3
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2005-10-20 12:23:45] nohn@php.net
184c185,192
< if (strlen($ui1) == strlen($ui2) && strlen($ui1) == 19 && $ui1 !=
$ui2) {
---
>
> if (strtoupper(substr(php_uname(), 0, 6)) === 'CYGWIN') {
> $expected_length = 29;
> } else {
> $expected_length = 19;
> }
>
> if (strlen($ui1) == strlen($ui2) && strlen($ui1) == $expected_length
&& $ui1 != $ui2) {
------------------------------------------------------------------------
[2005-10-20 11:16:19] tony2001@php.net
So make a patch then and make sure that it works for you on Cygwin.
I don't have Cygwin anywhere and I'm sure Ilia doesn't have it either.
------------------------------------------------------------------------
[2005-10-20 10:33:48] nohn@php.net
Tony:
-----
You don't need to find that out. Either set it always to true or always
to false:
$ui1 = uniqid($str, false);
$ui2 = uniqid($str, false);
Of course you could also use php_uname() for that. Cygwin identifies as
Cygwin, so there is no problem here.
Ilia:
-----
That behaviour is not documented on http://de2.php.net/uniqid
------------------------------------------------------------------------
[2005-10-19 23:17:45] tony2001@php.net
Do you know of any way to detect if PHP is running on Cygwin from PHP
itself?
------------------------------------------------------------------------
[2005-10-19 19:38:23] nohn@php.net
Reopening.
In that case, tests/strings/001.phpt needs to behave different on
Cygwin than on other systems.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/34908
--
Edit this bug report at http://bugs.php.net/?id=34908&edit=1