* Fix image uploading with image redirects enabled
* Escape titles
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 ) . "'";
}
return false;
}
- if( $title->getNamespace() == NS_MEDIA ) {
+ if( $title instanceof Title && $title->getNamespace() == NS_MEDIA ) {
$title = Title::makeTitle( NS_IMAGE, $title->getText() );
}