X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2FEditPage.php;h=1f526cce3e09b665f005dcc762e1162530b8f01f;hb=58852d882752b46a1c2b79d2476489dfbc978f5f;hp=9e337fde31cb48e1a0e174a8d7bc4e5e6d107977;hpb=3bbda787b821cfd03c21a57012756b57d3fa43e4;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/EditPage.php b/includes/EditPage.php index 9e337fde31..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; } @@ -1063,7 +1063,6 @@ class EditPage { ''; return true; } - return false; } /** @@ -1471,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 ) { @@ -2415,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', @@ -2426,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
";