Doc #77712 [Opn->Asn]: Wrong syntax for WWW-Authenticate header in example #2
| From: | jhdxr@php.net | Date: | Sat, 09 Mar 2019 09:23:45 +0000 |
| Subject: | Doc #77712 [Opn->Asn]: Wrong syntax for WWW-Authenticate header in example #2 | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-16453@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77712&edit=1
ID: 77712
Updated by: jhdxr@php.net
Reported by: admin at yangdx dot com
Summary: Wrong syntax for WWW-Authenticate header in example
#2
-Status: Open
+Status: Assigned
Type: Documentation Problem
Package: Translation problem
PHP Version: 7.3.3
-Assigned To:
+Assigned To: jhdxr
Block user comment: N
Private report: N
New Comment:
sorry, the example in en version is correct. I'm fixing it in zh version.
Previous Comments:
------------------------------------------------------------------------
[2019-03-09 09:22:14] jhdxr@php.net
The example is used in en version as well so this is not a translation issue, we should fix the all
the docs
------------------------------------------------------------------------
[2019-03-08 17:54:30] admin at yangdx dot com
Description:
------------
---
From manual page: http://php.net/manual/zh/features.http-auth.php
---
On this page, the code for the second example is wrong.
the code:
------------------
header('WWW-Authenticate: Digest realm="'.$realm.
'" qop="auth" nonce="'.uniqid().'"
opaque="'.md5($realm).'"');
------------------
should be:
------------------
header('WWW-Authenticate: Digest realm="'.$realm.
'",qop="auth",nonce="'.uniqid().'",opaque="'.md5($realm).'"');
------------------
Test script:
---------------
if (empty($_SERVER['PHP_AUTH_DIGEST'])) {
header('HTTP/1.1 401 Unauthorized');
header('WWW-Authenticate: Digest realm="'.$realm.
'", qop="auth", nonce="'.uniqid().'",
opaque="'.md5($realm).'"');
die('Text to send if user hits Cancel button');
}
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77712&edit=1