Optionally allow non-HTML4-compatible ids
authorAryeh Gregor <simetrical@users.mediawiki.org>
Tue, 30 Dec 2008 00:22:34 +0000 (00:22 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Tue, 30 Dec 2008 00:22:34 +0000 (00:22 +0000)
commitd7371cc6959004aae84d6520b6d0c98352dc39a8
tree6abf4ca70e4fbceb38ef7deebf8daaa2e7a549c5
parent69d11310ffa55819c75e0b04621182669f9cb1f1
Optionally allow non-HTML4-compatible ids

This adds a config option, $wgEnforceHtmlIds, true by default.  If this
is set to false, all characters that are allowed in XML ids are let
through in header ids and manually-specified ids.  In particular, this
should include all alphabetic and numeric characters.

Some remaining issues to work out:

* This will cause backward-compatibility issues for some types of links
and references: links from non-MediaWiki sources, links from MediaWiki
sources running a different version, external links, and references from
stylesheets/scripts.  These could be partially alleviated by having a
second <a name="" id=""> for headers where the two versions differ, but
it would remain an issue for manually-specified id's.
* Any invalid characters are now, effectively, stripped (replaced with
underscores).  This might cause problems if some writing systems are
invalid in id's for some reason: we'll want to double-check the list of
prohibited characters carefully.
* Some user agents might not support these links.  IE5 appears to, and
so do recent versions of Opera and Firefox, but I didn't do extensive
testing.
* Not tested extensively, there are probably some bugs.

I think this would be good to enable on testwiki for the moment to see
how it goes.

No parser test regressions.  No change to RELEASE-NOTES, we can add that
when the option is enabled by default (ideally, removed entirely).
includes/DefaultSettings.php
includes/Sanitizer.php
includes/Title.php
includes/parser/Parser.php
maintenance/parserTests.inc