php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #69449 htmlspecialchars() flags documentation isn't complete
Submitted: 2015-04-14 17:48 UTC Modified: 2017-03-13 12:46 UTC
From: olafvdspek at gmail dot com Assigned: narf (profile)
Status: Closed Package: Strings related
PHP Version: Irrelevant OS: *
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: olafvdspek at gmail dot com
New email:
PHP Version: OS:

 

 [2015-04-14 17:48 UTC] olafvdspek at gmail dot com
Description:
------------
> The default is ENT_COMPAT | ENT_HTML401.

http://php.net/htmlspecialchars

So what does it do when you pass just ENT_HTML401? Or just ENT_COMPAT?
Or both ENT_QUOTES and ENT_NOQUOTES?


Test script:
---------------
-


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-04-14 19:38 UTC] cmb@php.net
-Status: Open +Status: Not a bug -Assigned To: +Assigned To: cmb
 [2015-04-14 19:38 UTC] cmb@php.net
In these cases the behavior is as usual when one passes an argument
to an optional parameter: the passed argument overrides the
default. There is nothing special to bitmasks in this regard. I
don't see that this needs explicit documentation for individual
functions.
 [2015-04-14 20:11 UTC] olafvdspek at gmail dot com
I know the default is overriden and bitmasks are nothing special, but what does the function do in that case?
It's not clear from the documentation.
 [2015-04-14 20:26 UTC] cmb@php.net
-Status: Not a bug +Status: Re-Opened -Assigned To: cmb +Assigned To:
 [2015-04-14 20:26 UTC] cmb@php.net
I was a bit quick in my judgement and have to admit that you're
right; the documentation isn't clear enough. Thanks for broaching
the subject again.

FWIW: the code[1] clarifies the issue somewhat.

[1] <http://lxr.php.net/xref/PHP_5_6/ext/standard/html.h#24>
 [2015-04-20 22:28 UTC] cmb@php.net
-Type: Bug +Type: Documentation Problem -Package: Documentation problem +Package: Strings related
 [2017-03-13 12:42 UTC] narf@php.net
Automatic comment from SVN on behalf of narf
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=342108
Log: Fix docs bug #69449: Explain what happens with ambiguous/missing htmlspecialchars() flags
 [2017-03-13 12:46 UTC] narf@php.net
-Status: Re-Opened +Status: Closed -Assigned To: +Assigned To: narf
 [2017-03-13 12:46 UTC] narf@php.net
Fixed in SVN sources.

It takes some time for the changes to propagate though ... IIRC it happens regularly around UTC+1.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 14:01:32 2024 UTC