php.net |  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
 [2008-09-15 23:12 UTC] joeedh at gmail dot com
Description:
------------
Case folding is against the XML standard, as stated in:

http://markmail.org/message/exlh6us4wpbt7juk#query:xml%20case%20folding%20xml-dev+page:1+mid:rikx6p3veteu5und+state:results

and:

http://www.xml.com/axml/notes/CaseSensitive.html

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 
  do.

* 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.



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-09-16 06:10 UTC] chregu@php.net
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-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 06:01:30 2024 UTC