(bug 973) quickie brake for images with many many uses
[lhc/web/wiklou.git] / includes / ImagePage.php
index dc7c67f..139f024 100644 (file)
@@ -132,7 +132,8 @@ class ImagePage extends Article {
                $imagelinks = $dbr->tableName( 'imagelinks' );
                
                $sql = "SELECT cur_namespace,cur_title FROM $imagelinks,$cur WHERE il_to=" .
-                 $dbr->addQuotes( $this->mTitle->getDBkey() ) . " AND il_from=cur_id";
+                 $dbr->addQuotes( $this->mTitle->getDBkey() ) . " AND il_from=cur_id"
+                 . " LIMIT 500"; # quickie emergency brake
                $res = $dbr->query( $sql, DB_SLAVE, "Article::imageLinks" );
 
                if ( 0 == $dbr->numRows( $res ) ) {