From d0d3d059b56ba24d0d0c6b8ee81ff086691ed5a3 Mon Sep 17 00:00:00 2001 From: Aryeh Gregor Date: Sun, 30 May 2010 17:33:59 +0000 Subject: [PATCH] Remove most named character references from output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Recommit of r66254 to trunk. This was just find extensions phase3 -iname '*.php' \! -iname '*.i18n.php' \! -iname 'Messages*.php' \! -iname '*_Messages.php' -exec sed -i 's/ /\ /g;s/—/―/g;s/•/•/g;s/á/á/g;s/´/´/g;s/à/à/g;s/α/α/g;s/ä/ä/g;s/ç/ç/g;s/©/©/g;s/↓/↓/g;s/°/°/g;s/é/é/g;s/ê/ê/g;s/ë/ë/g;s/è/è/g;s/€/€/g;s/↔//g;s/…/…/g;s/í/í/g;s/ì/ì/g;s/←/←/g;s/“/“/g;s/·/·/g;s/−/−/g;s/–/–/g;s/ó/ó/g;s/ô/ô/g;s/œ/œ/g;s/ò/ò/g;s/õ/õ/g;s/ö/ö/g;s/£/£/g;s/′/′/g;s/″/″/g;s/»/»/g;s/→/→/g;s/”/”/g;s/Σ/Σ/g;s/×/×/g;s/ú/ú/g;s/↑/↑/g;s/ü/ü/g;s/¥/¥/g' {} + followed by reading over every single line of the resulting diff and fixing a whole bunch of false positives. The reason for this change is given in . I cleared it with Tim and Brion on IRC before committing. It might cause a few problems, but I tried to be careful; please report any issues. I skipped all messages files. I plan to make a follow-up commit that alters wfMsgExt() with 'escapenoentities' to sanitize all the entities. That way, the only messages that will be problems will be ones that output raw HTML, and we want to get rid of those anyway. This should get rid of all named entities everywhere except messages. I skipped a few things like   that I noticed in manual inspection, because they weren't well-formed XML anyway. Also, to everyone who uses non-breaking spaces when they could use a normal space, or nothing at all, or CSS padding: I still hate you. Die. --- Gadgets.php | 4 ++-- SpecialGadgets.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gadgets.php b/Gadgets.php index 605b0aa8..c6df7434 100644 --- a/Gadgets.php +++ b/Gadgets.php @@ -136,7 +136,7 @@ function wfGadgetsGetPreferences( $user, &$preferences ) { $preferences['gadgets-intro'] = array( 'type' => 'info', - 'label' => ' ', + 'label' => ' ', 'default' => Xml::tags( 'tr', array(), Xml::tags( 'td', array( 'colspan' => 2 ), wfMsgExt( 'gadgets-prefstext', 'parse' ) ) ), @@ -150,7 +150,7 @@ function wfGadgetsGetPreferences( $user, &$preferences ) { 'type' => 'multiselect', 'options' => $options, 'section' => 'gadgets', - 'label' => ' ', + 'label' => ' ', 'prefix' => 'gadget-', ); diff --git a/SpecialGadgets.php b/SpecialGadgets.php index 725592bc..6fb20e17 100644 --- a/SpecialGadgets.php +++ b/SpecialGadgets.php @@ -59,7 +59,7 @@ class SpecialGadgets extends SpecialPage { $lnkTarget = $t ? $skin->link( $t, wfMsgHTML( 'edit' ), array(), array( 'action' => 'edit' ) ) : htmlspecialchars( $section ); - $lnk = "    [$lnkTarget]"; + $lnk = "    [$lnkTarget]"; } else { $lnk = ''; } @@ -78,7 +78,7 @@ class SpecialGadgets extends SpecialPage { if ( $editInterfaceAllowed ) { $lnkTarget = $skin->link( $t, wfMsgHTML( 'edit' ), array(), array( 'action' => 'edit' ) ); - $lnk = "    [$lnkTarget]"; + $lnk = "    [$lnkTarget]"; } else { $lnk = ''; }