Doc #61363 [Com]: Wrong defaults in htmlspecialchars() manual

From: Date: Tue, 13 Mar 2012 17:08:28 +0000
Subject: Doc #61363 [Com]: Wrong defaults in htmlspecialchars() manual
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-8054@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=61363&edit=1 ID: 61363 Comment by: tokul at users dot sourceforge dot net Reported by: tokul at users dot sourceforge dot net Summary: Wrong defaults in htmlspecialchars() manual Status: Not a bug Type: Documentation Problem Package: Documentation problem PHP Version: 5.4.0 Block user comment: N Private report: N New Comment: > it helps to convey that .... And it has nothing to do with htmlspecialchars function. Function sanitizes strings. It does not do anything related to doctype. Stop inventing new syntaxes for writing default values in documentation. Previous Comments: ------------------------------------------------------------------------ [2012-03-12 21:34:28] cataphract@php.net The documentation is correct. $x | 0 == $x for any integer $x. While the ENT_HTML401 constant could be omitted from the default value, it helps to convey that the default document type is HTML 4.01. ------------------------------------------------------------------------ [2012-03-12 20:30:58] tokul at users dot sourceforge dot net Description: ------------ You have typo in htmlspecialchars() manual (online version for 2012-03-12 date). ENT_COMPAT is not the same as ENT_HTML401. Function can't have two different values as default. ENT_COMPAT is int(2). ENT_HTML401 is int(0) Sorry, if it is already fixed in source repo. I can see only online version and I can't find htmlspecialchars related report on this problem. Test script: --------------- <?php var_dump(ENT_COMPAT); var_dump(ENT_HTML401); var_dump(htmlspecialchars('"')); Expected result: ---------------- int(2) int(0) string(6) "&quot;" ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=61363&edit=1

« previous php.doc.bugs (#8054) next »