Merge "Drop index oi_name_archive_name on table oldimage"
[lhc/web/wiklou.git] / includes / page / ImagePage.php
index c6c865c..f8202a6 100644 (file)
@@ -20,6 +20,8 @@
  * @file
  */
 
+use Wikimedia\Rdbms\ResultWrapper;
+
 /**
  * Class for viewing MediaWiki file description pages
  *
@@ -585,6 +587,8 @@ EOT
                } else {
                        # Image does not exist
                        if ( !$this->getId() ) {
+                               $dbr = wfGetDB( DB_REPLICA );
+
                                # No article exists either
                                # Show deletion log to be consistent with normal articles
                                LogEventsList::showLogExtract(
@@ -593,7 +597,7 @@ EOT
                                        $this->getTitle()->getPrefixedText(),
                                        '',
                                        [ 'lim' => 10,
-                                               'conds' => [ "log_action != 'revision'" ],
+                                               'conds' => [ 'log_action != ' . $dbr->addQuotes( 'revision' ) ],
                                                'showIfEmpty' => false,
                                                'msgKey' => [ 'moveddeleted-notice' ]
                                        ]