Bug #78692 [Fbk->Asn]: define() and defined() not behaving correctly on Windows 10
| From: | security at paragonie dot com | Date: | Sat, 19 Oct 2019 14:33:23 +0000 |
| Subject: | Bug #78692 [Fbk->Asn]: define() and defined() not behaving correctly on Windows 10 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-223297@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78692&edit=1
ID: 78692
User updated by: security at paragonie dot com
Reported by: security at paragonie dot com
Summary: define() and defined() not behaving correctly on
Windows 10
-Status: Feedback
+Status: Assigned
Type: Bug
Package: *General Issues
Operating System: Windows
PHP Version: 7.2.15
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
I have no earthly clue.
As I said in my first post, I'm just the messenger. Someone else had the problem, and I
couldn't reproduce it at all. My Windows environment "just works".
I was simply reporting this in the hopes that someone from Internals would succeed in reproducing
the failure where I did not.
If it turns out to be an old bug, cool, then the responsibility falls on the Windows users to
upgrade to later versions of PHP and we can "CLOSED WONTFIX" any complaints they levy
against 7.2.15.
If it turns out to be a new bug, great, now we can fix it. :)
But I laid all my cards on the table in my first comment.
Previous Comments:
------------------------------------------------------------------------
[2019-10-19 14:25:22] cmb@php.net
Thanks! Did upgrading to any more recent PHP 7.2 solve the issue?
------------------------------------------------------------------------
[2019-10-19 13:53:14] security at paragonie dot com
Corrected.
------------------------------------------------------------------------
[2019-10-19 12:05:50] cmb@php.net
This is somewhat unlikely a Windows 10 specific issue. Anyhow,
about which PHP version is it? You've specified 7.3.10 in the
header, but stating the issue occured with 7.2.15.
------------------------------------------------------------------------
[2019-10-18 15:27:59] security at paragonie dot com
Description:
------------
Found upstream: https://github.com/paragonie/sodium_compat/issues/99
Apparently, when someone installs paragonie/certainty on a specific Windows setup (according to the
user, they are using "Win10 Enterprise 1809 and PHP 7.2.15 x64 NTS"), with sodium_compat
1.11.1, they were getting notices.
This _may_ be related to https://bugs.php.net/bug.php?id=77621 (not
guaranteed), but I'm having a frustrating time trying to reproduce this behavior (and failing
every time).
In the offchance that there is a Windows bug here (I assumed a race condition with the autoloader,
but that doesn't seem to be the cause), I wanted to make sure it's reported upstream.
Test script:
---------------
Add this to composer.json on the described environment:
"require": {
"paragonie/certainty": "^2",
"paragonie/sodium_compat": "1.11.1"
}
Then run
composer install. Then run this:
<?php
use ParagonIE\Certainty\RemoteFetch;
$fetcher = new RemoteFetch('/path/to/certainty/data');
$latestCACertBundle = $fetcher->getLatestBundle();
$ch = curl_init('https://secure.php.net');
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
curl_setopt($ch, CURLOPT_CAINFO, $latestCACertBundle->getFilePath());
If you get a bunch of E_WARNING errors, congratulations! You've reproduced it.
Expected result:
----------------
No output.
Actual result:
--------------
Lots of warnings that look like
PHP Warning: constant(): Couldn't find constant ParagonIE_Sodium_Compat::CONSTANT_NAME in
C:\htdocs\www\testing\vendor\paragonie\sodium_compat\lib\php72compat.php on line 91
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78692&edit=1