$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 ) ) {