summaryrefslogtreecommitdiff
path: root/includes/specials/SpecialListfiles.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/specials/SpecialListfiles.php')
-rw-r--r--includes/specials/SpecialListfiles.php22
1 files changed, 11 insertions, 11 deletions
diff --git a/includes/specials/SpecialListfiles.php b/includes/specials/SpecialListfiles.php
index e15b6959..b9332422 100644
--- a/includes/specials/SpecialListfiles.php
+++ b/includes/specials/SpecialListfiles.php
@@ -34,13 +34,11 @@ class ImageListPager extends TablePager {
}
$search = $wgRequest->getText( 'ilsearch' );
if ( $search != '' && !$wgMiserMode ) {
- $nt = Title::newFromUrl( $search );
+ $nt = Title::newFromURL( $search );
if( $nt ) {
$dbr = wfGetDB( DB_SLAVE );
- $m = $dbr->strencode( strtolower( $nt->getDBkey() ) );
- $m = str_replace( "%", "\\%", $m );
- $m = str_replace( "_", "\\_", $m );
- $this->mQueryConds = array( "LOWER(img_name) LIKE '%{$m}%'" );
+ $this->mQueryConds = array( 'LOWER(img_name)' . $dbr->buildLike( $dbr->anyString(),
+ strtolower( $nt->getDBkey() ), $dbr->anyString() ) );
}
}
@@ -127,21 +125,23 @@ class ImageListPager extends TablePager {
global $wgLang;
switch ( $field ) {
case 'img_timestamp':
- return $wgLang->timeanddate( $value, true );
+ return htmlspecialchars( $wgLang->timeanddate( $value, true ) );
case 'img_name':
static $imgfile = null;
if ( $imgfile === null ) $imgfile = wfMsg( 'imgfile' );
$name = $this->mCurrentRow->img_name;
- $link = $this->getSkin()->makeKnownLinkObj( Title::makeTitle( NS_FILE, $name ), $value );
+ $link = $this->getSkin()->linkKnown( Title::makeTitle( NS_FILE, $name ), $value );
$image = wfLocalFile( $value );
$url = $image->getURL();
$download = Xml::element('a', array( 'href' => $url ), $imgfile );
return "$link ($download)";
case 'img_user_text':
if ( $this->mCurrentRow->img_user ) {
- $link = $this->getSkin()->makeLinkObj( Title::makeTitle( NS_USER, $value ),
- htmlspecialchars( $value ) );
+ $link = $this->getSkin()->link(
+ Title::makeTitle( NS_USER, $value ),
+ htmlspecialchars( $value )
+ );
} else {
$link = htmlspecialchars( $value );
}
@@ -156,10 +156,10 @@ class ImageListPager extends TablePager {
}
function getForm() {
- global $wgRequest, $wgMiserMode;
+ global $wgRequest, $wgScript, $wgMiserMode;
$search = $wgRequest->getText( 'ilsearch' );
- $s = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $this->getTitle()->getLocalURL(), 'id' => 'mw-listfiles-form' ) ) .
+ $s = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-listfiles-form' ) ) .
Xml::openElement( 'fieldset' ) .
Xml::element( 'legend', null, wfMsg( 'listfiles' ) ) .
Xml::tags( 'label', null, wfMsgHtml( 'table_pager_limit', $this->getLimitSelect() ) );