r31837 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r31836‎ | r31837 | r31838 >
Date:23:37, 11 March 2008
Author:brion
Status:old
Tags:
Comment:
Let the cleanup begin!
* Remove mystery UTF-8 decoding on debug stuff
* use rawurlencode, not urlencode; page names may legitimately include +
Modified paths:
  • /trunk/extensions/DidYouMean/DidYouMean.php (modified) (history)

Diff [purge]

Index: trunk/extensions/DidYouMean/DidYouMean.php
@@ -95,16 +95,16 @@
9696
9797 # normalize entities and urlencoding to pure utf-8
9898 foreach ($sees as &$value)
99 - $value = urldecode(html_entity_decode($value, ENT_QUOTES, 'UTF-8'));
 99+ $value = rawurldecode(html_entity_decode($value, ENT_QUOTES, 'UTF-8'));
100100
101 - wfDebug( 'HIPP: Parser: ' . utf8_decode(implode(', ', $sees)) . "\n" );
102 - wfDebug( 'HIPP: DBase: ' . utf8_decode(implode(', ', $parser->mDymSees)) . "\n" );
 101+ wfDebug( 'HIPP: Parser: ' . implode(', ', $sees) . "\n" );
 102+ wfDebug( 'HIPP: DBase: ' . implode(', ', $parser->mDymSees) . "\n" );
103103
104104 # add in the stuff from the database lookup
105105 $sees = array_unique(array_merge($sees, $parser->mDymSees));
106106 sort($sees);
107107
108 - wfDebug( 'HIPP: Merged: ' . utf8_decode(implode(', ', $sees)) . "\n" );
 108+ wfDebug( 'HIPP: Merged: ' . implode(', ', $sees) . "\n" );
109109
110110 # TODO is it better to use $parser->insertStripItem() ?
111111
@@ -178,7 +178,7 @@
179179 # accumulate the db results
180180 while( $o = $dbr->fetchObject( $res ) ) {
181181 $t2 = str_replace('_', ' ', $o->page_title);
182 - $dbo = utf8_decode($t2);
 182+ $dbo = $t2;
183183 if ($title != $t2) {
184184 array_push( $sees, $t2 );
185185 $dbo = '++ ' . $dbo;

Status & tagging log