|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46089 Case folding should be off by default
Submitted: 2008-09-15 23:12 UTC Modified: 2008-09-16 06:10 UTC
From: joeedh at gmail dot com Assigned:
Status: Wont fix Package: XML related
PHP Version: 5.2.6 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: joeedh at gmail dot com
New email:
PHP Version: OS:


 [2008-09-15 23:12 UTC] joeedh at gmail dot com
Case folding is against the XML standard, as stated in:


A previous bug was submitted in 2003 about this issue; the decision then was that backwards compatibility trumped adhering to the standard.  I'd like to resubmit this issue for consideration, with the following arguments:

* XML is a standard.  As such, people expect XML parsers to all 
  behave the same way within reasonable limits.  Violating the 
  standard is definitely something people never expect the parser to 

* Backwards compatibility is important, yet there are ways to  
  mitigate the problems.  Deprecation warning are used a lot.  
  Unfortunately, they'd be fairly tricky in this case.

  I guess one way would be to have a flag in php.ini to use
  the old default.  And also perhaps have a version
  of PHP (with the same default) that spat out warnings if the
  case folding setting isn't user-set *with a note about the
  php.ini flag and that the default will change next version*
  (of course the warnings would be disabled if the flag is set).

  As evil as that would be, it's the only deprecation warning
  scheme I can think of (not that I have the slightest
  experience deprecating aspects of APIs or languages :) ).

* Finally, to expand on my first point, since case folding is against 
  the XML spec, enabling it by default screws everyone over who is 
  using XML precisely because it *is* a standard.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-09-16 06:10 UTC]
Turning it off is a oneliner in your script and if you do a php.ini, you 
have to do this oneliner nevertheless as you never know, if it does 
casefolding or not. Even if ou don't write php scripts for the "public", 
you may have two scripts, one expects casefolding as the default, the 
other doesn't, so both have to do the xml_parser_set_option line

Changing the default doesn't actually help anyone, it is just actually 
more work to anyone and this behaviour is well documented. 

The newer XML extensions like XML Reader and DOM of course do not do 
case-folding anymore 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Nov 23 20:01:23 2020 UTC