Revert r39055 for now "Optional 'edit notices' on a per-namespace and per-page basis...
authorBrion Vibber <brion@users.mediawiki.org>
Sun, 10 Aug 2008 20:01:38 +0000 (20:01 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sun, 10 Aug 2008 20:01:38 +0000 (20:01 +0000)
Sanitizer::escapeClass() isn't really suitable for constructing message key names; a lot of names won't be easy to predict and it would be difficult for people to set up a custom message for, say, a page name containing punctuation or non-ASCII characters.

The check for message availability is using wfMsgForContent() for the content language, but then the output is done via $wgOut->addWikiMsg() which will use the UI language. Is this the desired behavior?

includes/EditPage.php

index 59438d4..160e0f1 100644 (file)
@@ -455,16 +455,6 @@ class EditPage {
                        $wgOut->addWikiMsg( 'talkpagetext' );
                }
 
-               # Optional notices on a per-namespace and per-page basis
-               $editnotice_ns   = 'editnotice-'.Sanitizer::escapeClass( 'ns-'.$this->mTitle->getNamespace() );
-               $editnotice_page = 'editnotice-'.Sanitizer::escapeClass( 'page-'.$this->mTitle->getPrefixedText() );
-               if ( !wfEmptyMsg( $editnotice_ns, wfMsgForContent( $editnotice_ns ) ) ) {
-                       $wgOut->addWikiMsg( $editnotice_ns );
-               }
-               if ( !wfEmptyMsg( $editnotice_page, wfMsgForContent( $editnotice_page ) ) ) {
-                       $wgOut->addWikiMsg( $editnotice_page );
-               }
-
                # Attempt submission here.  This will check for edit conflicts,
                # and redundantly check for locked database, blocked IPs, etc.
                # that edit() already checked just in case someone tries to sneak