$revision = $this->mArticle->getRevisionFetched();
if ( $revision === null ) {
if ( !$this->contentModel ) {
- $this->contentModel = $this->getTitle()->getContentModel();
+ throw new RuntimeException( 'EditPage contentModel was false' );
}
$handler = ContentHandler::getForModelID( $this->contentModel );
if ( $content === false || $content === null ) {
if ( !$this->contentModel ) {
- $this->contentModel = $this->getTitle()->getContentModel();
+ throw new RuntimeException( 'EditPage contentModel was false' );
}
$handler = ContentHandler::getForModelID( $this->contentModel );
}
# Give a notice if the user is editing a deleted/moved page...
if ( !$this->mTitle->exists() ) {
+ $dbr = wfGetDB( DB_REPLICA );
+
LogEventsList::showLogExtract( $wgOut, [ 'delete', 'move' ], $this->mTitle,
'',
[
'lim' => 10,
- 'conds' => [ "log_action != 'revision'" ],
+ 'conds' => [ 'log_action != ' . $dbr->addQuotes( 'revision' ) ],
'showIfEmpty' => false,
'msgKey' => [ 'recreate-moveddeleted-warn' ]
]
use MediaWiki\Linker\LinkTarget;
use Wikimedia\Assert\Assert;
+use Wikimedia\Rdbms\LoadBalancer;
/**
* Class performing complex database queries related to WatchedItems.
if ( !isset( $options['start'] ) && !isset( $options['end'] ) ) {
if ( $db->getType() === 'mysql' ) {
// This is an index optimization for mysql
- $conds[] = "rc_timestamp > ''";
+ $conds[] = 'rc_timestamp > ' . $db->addQuotes( '' );
}
}