From 583e6ff8a15d3da5267bf9f04af3f9f29c094392 Mon Sep 17 00:00:00 2001 From: Victor Vasiliev Date: Sun, 20 Jan 2008 12:13:34 +0000 Subject: [PATCH] Gotta die today... * Fix image uploading with image redirects enabled * Escape titles --- includes/filerepo/LocalFile.php | 2 +- includes/filerepo/LocalRepo.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/filerepo/LocalFile.php b/includes/filerepo/LocalFile.php index 105fb74682..1a098ca2d3 100644 --- a/includes/filerepo/LocalFile.php +++ b/includes/filerepo/LocalFile.php @@ -577,7 +577,7 @@ class LocalFile extends File function getHistory($limit = null, $start = null, $end = null) { $dbr = $this->repo->getSlaveDB(); $conds = $opts = array(); - $conds[] = "oi_name = '" . $this->title->getDBKey() . "'"; + $conds[] = "oi_name = " . $dbr->addQuotes( $this->title->getDBKey() ); if( $start !== null ) { $conds[] = "oi_timestamp < '" . $dbr->timestamp( $start ) . "'"; } diff --git a/includes/filerepo/LocalRepo.php b/includes/filerepo/LocalRepo.php index 8601881715..a259bd4851 100644 --- a/includes/filerepo/LocalRepo.php +++ b/includes/filerepo/LocalRepo.php @@ -90,7 +90,7 @@ class LocalRepo extends FSRepo { return false; } - if( $title->getNamespace() == NS_MEDIA ) { + if( $title instanceof Title && $title->getNamespace() == NS_MEDIA ) { $title = Title::makeTitle( NS_IMAGE, $title->getText() ); } -- 2.20.1