Gotta die today...
authorVictor Vasiliev <vasilievvv@users.mediawiki.org>
Sun, 20 Jan 2008 12:13:34 +0000 (12:13 +0000)
committerVictor Vasiliev <vasilievvv@users.mediawiki.org>
Sun, 20 Jan 2008 12:13:34 +0000 (12:13 +0000)
* Fix image uploading with image redirects enabled
* Escape titles

includes/filerepo/LocalFile.php
includes/filerepo/LocalRepo.php

index 105fb74..1a098ca 100644 (file)
@@ -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 ) . "'";
                }
index 8601881..a259bd4 100644 (file)
@@ -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() );
                }