/**
* Is $wgUser watching this page?
*
+ * @deprecated in 1.20; use User::isWatched() instead.
* @return Bool
*/
public function userIsWatching() {
* @return Int or 0 if the page doesn't exist
*/
public function getLatestRevID( $flags = 0 ) {
- if ( $this->mLatestID !== false ) {
+ if ( !( $flags & Title::GAID_FOR_UPDATE ) && $this->mLatestID !== false ) {
return intval( $this->mLatestID );
}
# Calling getArticleID() loads the field from cache as needed
*
* - This is called from WikiPage::doEdit() and WikiPage::insertOn() to allow
* loading of the new page_id. It's also called from
- * WikiPage::doDeleteArticle()
+ * WikiPage::doDeleteArticleReal()
*
* @param $newid Int the new Article ID
*/
* @return Array of String the URLs
*/
public function getSquidURLs() {
- global $wgContLang;
-
$urls = array(
$this->getInternalURL(),
$this->getInternalURL( 'action=history' )
);
- // purge variant urls as well
- if ( $wgContLang->hasVariants() ) {
- $variants = $wgContLang->getVariants();
+ $pageLang = $this->getPageLanguage();
+ if ( $pageLang->hasVariants() ) {
+ $variants = $pageLang->getVariants();
foreach ( $variants as $vCode ) {
$urls[] = $this->getInternalURL( '', $vCode );
}
$wgUser->spreadAnyEditBlock();
return $err;
}
+ // Check suppressredirect permission
+ if ( $auth && !$wgUser->isAllowed( 'suppressredirect' ) ) {
+ $createRedirect = true;
+ }
// If it is a file, move it first.
// It is done before all other moving stuff is done because it's hard to revert.
*
* @param $nt Title the page to move to, which should be a redirect or nonexistent
* @param $reason String The reason for the move
- * @param $createRedirect Bool Whether to leave a redirect at the old title. Ignored
- * if the user doesn't have the suppressredirect right
+ * @param $createRedirect Bool Whether to leave a redirect at the old title. Does not check
+ * if the user has the suppressredirect right
* @throws MWException
*/
private function moveToInternal( &$nt, $reason = '', $createRedirect = true ) {
$logType = 'move';
}
- $redirectSuppressed = !$createRedirect && $wgUser->isAllowed( 'suppressredirect' );
+ $redirectSuppressed = !$createRedirect;
$logEntry = new ManualLogEntry( 'move', $logType );
$logEntry->setPerformer( $wgUser );