r50881 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r50880‎ | r50881 | r50882 >
Date:08:51, 22 May 2009
Author:nikerabbit
Status:ok
Tags:
Comment:
* Fix mimesearch for me... action for some reason was not enough to pass the title
* Escaping
Modified paths:
  • /trunk/phase3/includes/specials/SpecialMIMEsearch.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialMIMEsearch.php
@@ -65,15 +65,15 @@
6666
6767 $nt = Title::makeTitle( $result->namespace, $result->title );
6868 $text = $wgContLang->convert( $nt->getText() );
69 - $plink = $skin->makeLink( $nt->getPrefixedText(), $text );
 69+ $plink = $skin->makeLink( $nt->getPrefixedText(), htmlspecialchars($text) );
7070
7171 $download = $skin->makeMediaLinkObj( $nt, wfMsgHtml( 'download' ) );
7272 $bytes = wfMsgExt( 'nbytes', array( 'parsemag', 'escape'),
7373 $wgLang->formatNum( $result->img_size ) );
7474 $dimensions = wfMsgHtml( 'widthheight', $wgLang->formatNum( $result->img_width ),
7575 $wgLang->formatNum( $result->img_height ) );
76 - $user = $skin->link( Title::makeTitle( NS_USER, $result->img_user_text ), $result->img_user_text );
77 - $time = $wgLang->timeanddate( $result->img_timestamp );
 76+ $user = $skin->link( Title::makeTitle( NS_USER, $result->img_user_text ), htmlspecialchars( $result->img_user_text ) );
 77+ $time = htmlspecialchars( $wgLang->timeanddate( $result->img_timestamp ) );
7878
7979 return "($download) $plink . . $dimensions . . $bytes . . $user . . $time";
8080 }
@@ -90,6 +90,7 @@
9191 $wgOut->addHTML(
9292 Xml::openElement( 'form', array( 'id' => 'specialmimesearch', 'method' => 'get', 'action' => SpecialPage::getTitleFor( 'MIMEsearch' )->getLocalUrl() ) ) .
9393 Xml::openElement( 'fieldset' ) .
 94+ Xml::hidden( 'title', SpecialPage::getTitleFor( 'MIMEsearch' )->getPrefixedText() ) .
9495 Xml::element( 'legend', null, wfMsg( 'mimesearch' ) ) .
9596 Xml::inputLabel( wfMsg( 'mimetype' ), 'mime', 'mime', 20, $mime ) . ' ' .
9697 Xml::submitButton( wfMsg( 'ilsubmit' ) ) .

Status & tagging log