}
# 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' ]
]
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( '' );
}
}
$out->setStatusCode( 404 );
}
$out->addWikiMsg( 'nohistory' );
+
+ $dbr = wfGetDB( DB_REPLICA );
+
# show deletion/move log if there is an entry
LogEventsList::showLogExtract(
$out,
$this->getTitle(),
'',
[ 'lim' => 10,
- 'conds' => [ "log_action != 'revision'" ],
+ 'conds' => [ 'log_action != ' . $dbr->addQuotes( 'revision' ) ],
'showIfEmpty' => false,
'msgKey' => [ 'moveddeleted-notice' ]
]
* @param string $user The user who made the log entries
* @param array $param Associative Array with the following additional options:
* - lim Integer Limit of items to show, default is 50
- * - conds Array Extra conditions for the query (e.g. "log_action != 'revision'")
+ * - conds Array Extra conditions for the query
+ * (e.g. 'log_action != ' . $dbr->addQuotes( 'revision' ))
* - showIfEmpty boolean Set to false if you don't want any output in case the loglist is empty
* if set to true (default), "No matching items in log" is displayed if loglist is empty
* - msgKey Array If you want a nice box with a message, set this to the key of the message.
$loggedIn = $this->getContext()->getUser()->isLoggedIn();
if ( $loggedIn || $cache->get( $key ) ) {
$logTypes = [ 'delete', 'move' ];
- $conds = [ "log_action != 'revision'" ];
+
+ $dbr = wfGetDB( DB_REPLICA );
+
+ $conds = [ 'log_action != ' . $dbr->addQuotes( 'revision' ) ];
// Give extensions a chance to hide their (unrelated) log entries
Hooks::run( 'Article::MissingArticleConditions', [ &$conds, $logTypes ] );
LogEventsList::showLogExtract(
} 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(
$this->getTitle()->getPrefixedText(),
'',
[ 'lim' => 10,
- 'conds' => [ "log_action != 'revision'" ],
+ 'conds' => [ 'log_action != ' . $dbr->addQuotes( 'revision' ) ],
'showIfEmpty' => false,
'msgKey' => [ 'moveddeleted-notice' ]
]
$desiredTitleObj = Title::makeTitleSafe( NS_FILE, $this->mDesiredDestName );
$delNotice = ''; // empty by default
if ( $desiredTitleObj instanceof Title && !$desiredTitleObj->exists() ) {
+ $dbr = wfGetDB( DB_REPLICA );
+
LogEventsList::showLogExtract( $delNotice, [ 'delete', 'move' ],
$desiredTitleObj,
'', [ 'lim' => 10,
- 'conds' => [ "log_action != 'revision'" ],
+ 'conds' => [ 'log_action != ' . $dbr->addQuotes( 'revision' ) ],
'showIfEmpty' => false,
'msgKey' => [ 'upload-recreate-warning' ] ]
);