* (bug 8701) Check database lock status when blocking/unblocking users
* ParserOptions and ParserOutput classes are now in their own files
* (bug 8708) Namespace translations for Zealandic language
-* Renamed constructor methods to PHP5 __construct reserved name
+* Renamed constructor methods to PHP 5 __construct reserved name
+* (bug 8715) Warn users when editing an interface message whether or not the message page exists
== Languages updated ==
}
}
- if( $this->mTitle->isProtected( 'edit' ) ) {
-
- $cascadeSources = $this->mTitle->getCascadeProtectionSources( );
-
- # Is the protection due to the namespace, e.g. interface text?
- if( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
- # Yes; remind the user
- $notice = wfMsg( 'editinginterface' );
- } elseif( $this->mTitle->isSemiProtected() ) {
- # No; semi protected
+ if( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
+ # Show a warning if editing an interface message
+ $wgOut->addWikiText( wfMsg( 'editinginterface' ) );
+ } elseif( $this->mTitle->isProtected( 'edit' ) ) {
+ # Is the title semi-protected?
+ if( $this->mTitle->isSemiProtected() ) {
$notice = wfMsg( 'semiprotectedpagewarning' );
- if( wfEmptyMsg( 'semiprotectedpagewarning', $notice ) || $notice == '-' ) {
+ if( wfEmptyMsg( 'semiprotectedpagewarning', $notice ) || $notice == '-' )
$notice = '';
- }
- } elseif ($cascadeSources && count($cascadeSources) > 0) {
- # Cascaded protection: warn the user.
- $titles = '';
-
- foreach ( $cascadeSources as $title ) {
- $titles .= '* [[:' . $title->getPrefixedText() . "]]\n";
- }
-
- $notice = wfMsg( 'cascadeprotectedwarning' ) . "\r\n$titles";
} else {
- # No; regular protection
- $notice = wfMsg( 'protectedpagewarning' );
+ # It's either cascading protection or regular protection; work out which
+ $cascadeSources = $this->mTitle->getCascadeProtectionSources();
+ if( $cascadeSources && count( $cascadeSources ) > 0 ) {
+ # Cascading protection; explain, and list the titles responsible
+ $notice = wfMsg( 'cascadeprotectedwarning' ) . "\n";
+ foreach( $cascadeSources as $source )
+ $notice .= '* [[:' . $source->getPrefixedText() . "]]\n";
+ } else {
+ # Regular protection
+ $notice = wfMsg( 'protectedpagewarning' );
+ }
}
$wgOut->addWikiText( $notice );
}
function isProtected( $action = '' ) {
global $wgRestrictionLevels;
- if ( NS_SPECIAL == $this->mNamespace ) { return true; }
+ # Special pages have inherent protection
+ if( $this->getNamespace() == NS_SPECIAL )
+ return true;
+
+ # Cascading protection depends on more than
+ # this page...
+ if( $this->isCascadeProtected() )
+ return true;
- if ( $this->isCascadeProtected() ) { return true; }
-
+ # Check regular protection levels
if( $action == 'edit' || $action == '' ) {
$r = $this->getRestrictions( 'edit' );
foreach( $wgRestrictionLevels as $level ) {
the text into a text file and save it for later.</strong>',
'protectedpagewarning' => "<strong>WARNING: This page has been locked so that only users with sysop privileges can edit it.</strong>",
'semiprotectedpagewarning' => "'''Note:''' This page has been locked so that only registered users can edit it.",
-'cascadeprotectedwarning' => "<strong>WARNING: This page has been locked so that only users with sysop privileges can edit it, because it is included in the following pages, which are protected with the \"cascading protection\" option turned on.</strong>:",
+'cascadeprotectedwarning' => "'''Warning:''' This page has been locked so that only users with sysop privileges can edit it, because it is included in the following cascade-protected pages:",
'templatesused' => 'Templates used on this page:',
'templatesusedpreview' => 'Templates used in this preview:',
'templatesusedsection' => 'Templates used in this section:',