php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #77712 Wrong syntax for WWW-Authenticate header in example #2
Submitted: 2019-03-08 17:54 UTC Modified: 2019-03-09 09:37 UTC
From: admin at yangdx dot com Assigned: jhdxr (profile)
Status: Closed Package: Translation problem
PHP Version: 7.3.3 OS:
Private report: No CVE-ID: None
 [2019-03-08 17:54 UTC] 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');
}


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-03-08 18:41 UTC] requinix@php.net
-Summary: The example code for the translation page is wrong +Summary: [ZH] Wrong syntax for WWW-Authenticate header in example #2
 [2019-03-09 09:22 UTC] jhdxr@php.net
-Summary: [ZH] Wrong syntax for WWW-Authenticate header in example #2 +Summary: Wrong syntax for WWW-Authenticate header in example #2
 [2019-03-09 09:22 UTC] 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-09 09:23 UTC] jhdxr@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: jhdxr
 [2019-03-09 09:23 UTC] jhdxr@php.net
sorry, the example in en version is correct. I'm fixing it in zh version.
 [2019-03-09 09:36 UTC] jhdxr@php.net
Automatic comment from SVN on behalf of jhdxr
Revision: http://svn.php.net/viewvc/?view=revision&revision=346984
Log: sync with en version
remove php 4.x out-of-date contents
fix #77712 	Wrong syntax for WWW-Authenticate header in example #2
 [2019-03-09 09:37 UTC] jhdxr@php.net
-Status: Assigned +Status: Closed
 [2019-03-09 09:37 UTC] jhdxr@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-12-30 10:47 UTC] nikic@php.net
Automatic comment on behalf of jhdxr
Revision: http://git.php.net/?p=doc/zh.git;a=commit;h=bdde48c20963a947194afa64f5d107581e6669d2
Log: sync with en version remove php 4.x out-of-date contents fix #77712 	Wrong syntax for WWW-Authenticate header in example #2
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Apr 12 17:01:24 2021 UTC