From: Victor Vasiliev Date: Sun, 20 Jan 2008 12:13:34 +0000 (+0000) Subject: Gotta die today... X-Git-Tag: 1.31.0-rc.0~49890 X-Git-Url: http://git.cyclocoop.org/url?a=commitdiff_plain;h=583e6ff8a15d3da5267bf9f04af3f9f29c094392;p=lhc%2Fweb%2Fwiklou.git Gotta die today... * Fix image uploading with image redirects enabled * Escape titles --- 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() ); }