X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FEditPage.php;h=1f526cce3e09b665f005dcc762e1162530b8f01f;hb=5fb8b9619529453f05c243538fce6cf82a559298;hp=6e6f825f817e837f340f762b613ae27b0dd9a3a4;hpb=7790bcfdae1aadc0507e64ded5def399f6b89418;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/EditPage.php b/includes/EditPage.php index 6e6f825f81..1f526cce3e 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -756,7 +756,7 @@ class EditPage { } elseif ( $wgUser->getOption( 'watchcreations' ) && !$this->mTitle->exists() ) { # Watch creations $this->watchthis = true; - } elseif ( $this->mTitle->userIsWatching() ) { + } elseif ( $wgUser->isWatched( $this->mTitle ) ) { # Already watched $this->watchthis = true; } @@ -1470,7 +1470,7 @@ class EditPage { */ protected function commitWatch() { global $wgUser; - if ( $this->watchthis xor $this->mTitle->userIsWatching() ) { + if ( $wgUser->isLoggedIn() && $this->watchthis != $wgUser->isWatched( $this->mTitle ) ) { $dbw = wfGetDB( DB_MASTER ); $dbw->begin( __METHOD__ ); if ( $this->watchthis ) { @@ -2414,7 +2414,16 @@ HTML '' ); } + /** + * Get the copyright warning + * + * Renamed to getCopyrightWarning(), old name kept around for backwards compatibility + */ protected function getCopywarn() { + return self::getCopyrightWarning( $this->mTitle ); + } + + public static function getCopyrightWarning( $title ) { global $wgRightsText; if ( $wgRightsText ) { $copywarnMsg = array( 'copyrightwarning', @@ -2425,7 +2434,7 @@ HTML '[[' . wfMsgForContent( 'copyrightpage' ) . ']]' ); } // Allow for site and per-namespace customization of contribution/copyright notice. - wfRunHooks( 'EditPageCopyrightWarning', array( $this->mTitle, &$copywarnMsg ) ); + wfRunHooks( 'EditPageCopyrightWarning', array( $title, &$copywarnMsg ) ); return "
\n" . call_user_func_array( "wfMsgNoTrans", $copywarnMsg ) . "\n
";