X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FEditPage.php;h=1376d579e4c5d9391e335bfce1ad2124a4ce2a34;hb=aab43dd49523476f3ec28c695e43006446a7be7a;hp=6e6f825f817e837f340f762b613ae27b0dd9a3a4;hpb=938d6ec732ab8c38e223ddbf1cd8c695654fa007;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/EditPage.php b/includes/EditPage.php index 6e6f825f81..1376d579e4 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
"; @@ -2983,8 +2992,8 @@ HTML * failure, etc). * * @todo This doesn't include category or interlanguage links. - * Would need to enhance it a bit, maybe wrap them in XML - * or something... that might also require more skin + * Would need to enhance it a bit, "maybe wrap them in XML + * or something..." that might also require more skin * initialization, so check whether that's a problem. */ function livePreview() {