r39081 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r39080‎ | r39081 | r39082 >
Date:20:01, 10 August 2008
Author:brion
Status:old
Tags:
Comment:
Revert r39055 for now "Optional 'edit notices' on a per-namespace and per-page basis, per feature request 15102"

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?
Modified paths:
  • /trunk/phase3/includes/EditPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/EditPage.php
@@ -455,16 +455,6 @@
456456 $wgOut->addWikiMsg( 'talkpagetext' );
457457 }
458458
459 - # Optional notices on a per-namespace and per-page basis
460 - $editnotice_ns = 'editnotice-'.Sanitizer::escapeClass( 'ns-'.$this->mTitle->getNamespace() );
461 - $editnotice_page = 'editnotice-'.Sanitizer::escapeClass( 'page-'.$this->mTitle->getPrefixedText() );
462 - if ( !wfEmptyMsg( $editnotice_ns, wfMsgForContent( $editnotice_ns ) ) ) {
463 - $wgOut->addWikiMsg( $editnotice_ns );
464 - }
465 - if ( !wfEmptyMsg( $editnotice_page, wfMsgForContent( $editnotice_page ) ) ) {
466 - $wgOut->addWikiMsg( $editnotice_page );
467 - }
468 -
469459 # Attempt submission here. This will check for edit conflicts,
470460 # and redundantly check for locked database, blocked IPs, etc.
471461 # that edit() already checked just in case someone tries to sneak

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r39055Optional 'edit notices' on a per-namespace and per-page basis, per feature re...krimpet08:31, 10 August 2008

Status & tagging log