Not escaping strings makes me queasy, even if we're *pretty* sure that database times...
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 4 Feb 2008 22:37:33 +0000 (22:37 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 4 Feb 2008 22:37:33 +0000 (22:37 +0000)
Wrap an addQuotes around those timestamp calls...

includes/filerepo/LocalFile.php

index 3b936a6..f992aa3 100644 (file)
@@ -583,10 +583,10 @@ class LocalFile extends File
                $conds = $opts = array();
                $conds[] = "oi_name = " . $dbr->addQuotes( $this->title->getDBKey() );
                if( $start !== null ) {
-                       $conds[] = "oi_timestamp <= '" . $dbr->timestamp( $start ) . "'";
+                       $conds[] = "oi_timestamp <= " . $dbr->addQuotes( $dbr->timestamp( $start ) );
                }
                if( $end !== null ) {
-                       $conds[] = "oi_timestamp >= '" . $dbr->timestamp( $end ). "'";
+                       $conds[] = "oi_timestamp >= " . $dbr->addQuotes( $dbr->timestamp( $end ) );
                }
                if( $limit ) {
                        $opts['LIMIT'] = $limit;