r61055 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61054‎ | r61055 | r61056 >
Date:17:14, 14 January 2010
Author:platonides
Status:ok (Comments)
Tags:
Comment:
(bug 19226) First line renders differently on many UI messages
Added newlines before $1 to wrapWikiMsgs of <div>s

Also fixes r61052 utf-8 screw-up on RELEASE-NOTES.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/Article.php (modified) (history)
  • /trunk/phase3/includes/EditPage.php (modified) (history)
  • /trunk/phase3/includes/OutputPage.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialBooksources.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialConfirmemail.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialPreferences.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialRecentchangeslinked.php (modified) (history)
  • /trunk/phase3/includes/upload/UploadBase.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/upload/UploadBase.php
@@ -765,7 +765,7 @@
766766
767767 if ( !$wgAntivirusSetup[$wgAntivirus] ) {
768768 wfDebug( __METHOD__ . ": unknown virus scanner: $wgAntivirus\n" );
769 - $wgOut->wrapWikiMsg( '<div class="error">$1</div>', array( 'virus-badscanner', $wgAntivirus ) );
 769+ $wgOut->wrapWikiMsg( "<div class=\"error\">\n$1</div>", array( 'virus-badscanner', $wgAntivirus ) );
770770 return wfMsg( 'virus-unknownscanner' ) . " $wgAntivirus";
771771 }
772772
Index: trunk/phase3/includes/Article.php
@@ -1215,7 +1215,7 @@
12161216 $id = User::idFromName( $rootPart );
12171217 $ip = User::isIP( $rootPart );
12181218 if ( $id == 0 && !$ip ) { # User does not exist
1219 - $wgOut->wrapWikiMsg( '<div class="mw-userpage-userdoesnotexist error">$1</div>',
 1219+ $wgOut->wrapWikiMsg( '<div class="mw-userpage-userdoesnotexist error">\n$1</div>',
12201220 array( 'userpage-userdoesnotexist-view', $rootPart ) );
12211221 }
12221222 }
Index: trunk/phase3/includes/EditPage.php
@@ -772,16 +772,16 @@
773773 $id = User::idFromName( $username );
774774 $ip = User::isIP( $username );
775775 if ( $id == 0 && !$ip ) {
776 - $wgOut->wrapWikiMsg( '<div class="mw-userpage-userdoesnotexist error">$1</div>',
 776+ $wgOut->wrapWikiMsg( "<div class=\"mw-userpage-userdoesnotexist error\">\n$1</div>",
777777 array( 'userpage-userdoesnotexist', $username ) );
778778 }
779779 }
780780 # Try to add a custom edit intro, or use the standard one if this is not possible.
781781 if ( !$this->showCustomIntro() && !$this->mTitle->exists() ) {
782782 if ( $wgUser->isLoggedIn() ) {
783 - $wgOut->wrapWikiMsg( '<div class="mw-newarticletext">$1</div>', 'newarticletext' );
 783+ $wgOut->wrapWikiMsg( "<div class=\"mw-newarticletext\">\n$1</div>", 'newarticletext' );
784784 } else {
785 - $wgOut->wrapWikiMsg( '<div class="mw-newarticletextanon">$1</div>', 'newarticletextanon' );
 785+ $wgOut->wrapWikiMsg( "<div class=\"mw-newarticletextanon\">\n$1</div>", 'newarticletextanon' );
786786 }
787787 }
788788 # Give a notice if the user is editing a deleted/moved page...
@@ -1426,15 +1426,15 @@
14271427 }
14281428
14291429 if ( $this->missingComment ) {
1430 - $wgOut->wrapWikiMsg( '<div id="mw-missingcommenttext">$1</div>', 'missingcommenttext' );
 1430+ $wgOut->wrapWikiMsg( "<div id='mw-missingcommenttext'>\n$1</div>", 'missingcommenttext' );
14311431 }
14321432
14331433 if ( $this->missingSummary && $this->section != 'new' ) {
1434 - $wgOut->wrapWikiMsg( '<div id="mw-missingsummary">$1</div>', 'missingsummary' );
 1434+ $wgOut->wrapWikiMsg( "<div id='mw-missingsummary'>\n$1</div>", 'missingsummary' );
14351435 }
14361436
14371437 if ( $this->missingSummary && $this->section == 'new' ) {
1438 - $wgOut->wrapWikiMsg( '<div id="mw-missingcommentheader">$1</div>', 'missingcommentheader' );
 1438+ $wgOut->wrapWikiMsg( "<div id='mw-missingcommentheader'>\n$1</div>", 'missingcommentheader' );
14391439 }
14401440
14411441 if ( $this->hookError !== '' ) {
@@ -1464,7 +1464,7 @@
14651465 if ( wfReadOnly() ) {
14661466 $wgOut->wrapWikiMsg( "<div id=\"mw-read-only-warning\">\n$1\n</div>", array( 'readonlywarning', wfReadOnlyReason() ) );
14671467 } elseif ( $wgUser->isAnon() && $this->formtype != 'preview' ) {
1468 - $wgOut->wrapWikiMsg( '<div id="mw-anon-edit-warning">$1</div>', 'anoneditwarning' );
 1468+ $wgOut->wrapWikiMsg( "<div id=\"mw-anon-edit-warning\">\n$1</div>", 'anoneditwarning' );
14691469 } else {
14701470 if ( $this->isCssJsSubpage ) {
14711471 # Check the skin exists
@@ -1494,7 +1494,7 @@
14951495 if ( $this->mTitle->isCascadeProtected() ) {
14961496 # Is this page under cascading protection from some source pages?
14971497 list($cascadeSources, /* $restrictions */) = $this->mTitle->getCascadeProtectionSources();
1498 - $notice = "<div class='mw-cascadeprotectedwarning'>$1\n";
 1498+ $notice = "<div class='mw-cascadeprotectedwarning'>\n$1\n";
14991499 $cascadeSourcesCount = count( $cascadeSources );
15001500 if ( $cascadeSourcesCount > 0 ) {
15011501 # Explain, and list the titles responsible
@@ -1506,7 +1506,7 @@
15071507 $wgOut->wrapWikiMsg( $notice, array( 'cascadeprotectedwarning', $cascadeSourcesCount ) );
15081508 }
15091509 if ( !$this->mTitle->exists() && $this->mTitle->getRestrictions( 'create' ) ) {
1510 - $wgOut->wrapWikiMsg( '<div class="mw-titleprotectedwarning">$1</div>', 'titleprotectedwarning' );
 1510+ $wgOut->wrapWikiMsg( "<div class=\"mw-titleprotectedwarning\">\n$1</div>", 'titleprotectedwarning' );
15111511 }
15121512
15131513 if ( $this->kblength === false ) {
Index: trunk/phase3/includes/OutputPage.php
@@ -1451,7 +1451,7 @@
14521452 // Wiki is read only
14531453 $this->setPageTitle( wfMsg( 'readonly' ) );
14541454 $reason = wfReadOnlyReason();
1455 - $this->wrapWikiMsg( '<div class="mw-readonly-error">$1</div>', array( 'readonlytext', $reason ) );
 1455+ $this->wrapWikiMsg( '<div class="mw-readonly-error">\n$1</div>', array( 'readonlytext', $reason ) );
14561456 }
14571457
14581458 // Show source, if supplied
@@ -2045,11 +2045,13 @@
20462046 *
20472047 * For example:
20482048 *
2049 - * $wgOut->wrapWikiMsg( '<div class="error">$1</div>', 'some-error' );
 2049+ * $wgOut->wrapWikiMsg( "<div class='error'>\n$1</div>", 'some-error' );
20502050 *
20512051 * Is equivalent to:
20522052 *
2053 - * $wgOut->addWikiText( '<div class="error">' . wfMsgNoTrans( 'some-error' ) . '</div>' );
 2053+ * $wgOut->addWikiText( "<div class='error'>\n" . wfMsgNoTrans( 'some-error' ) . '</div>' );
 2054+ *
 2055+ * The newline after opening div is needed in some wikitext. See bug 19226.
20542056 */
20552057 public function wrapWikiMsg( $wrap /*, ...*/ ) {
20562058 $msgSpecs = func_get_args();
Index: trunk/phase3/includes/specials/SpecialRecentchangeslinked.php
@@ -52,7 +52,7 @@
5353 }
5454 $title = Title::newFromURL( $target );
5555 if( !$title || $title->getInterwiki() != '' ){
56 - $wgOut->wrapWikiMsg( '<div class="errorbox">$1</div><br clear="both" />', 'allpagesbadtitle' );
 56+ $wgOut->wrapWikiMsg( "<div class=\"errorbox\">\n$1</div><br style=\"clear: both\" />", 'allpagesbadtitle' );
5757 return false;
5858 }
5959 $this->mTargetTitle = $title;
Index: trunk/phase3/includes/specials/SpecialPreferences.php
@@ -36,7 +36,7 @@
3737 }
3838
3939 if ( $wgRequest->getCheck( 'eauth' ) ) {
40 - $wgOut->wrapWikiMsg( "<div class='error' style='clear: both;'>$1</div>",
 40+ $wgOut->wrapWikiMsg( "<div class='error' style='clear: both;'>\n$1</div>",
4141 'eauthentsent', $wgUser->getName() );
4242 }
4343
Index: trunk/phase3/includes/specials/SpecialBooksources.php
@@ -35,7 +35,7 @@
3636 $wgOut->addHTML( $this->makeForm() );
3737 if( strlen( $this->isbn ) > 0 ) {
3838 if( !self::isValidISBN( $this->isbn ) ) {
39 - $wgOut->wrapWikiMsg( '<div class="error">$1</div>', 'booksources-invalid-isbn' );
 39+ $wgOut->wrapWikiMsg( "<div class=\"error\">\n$1</div>", 'booksources-invalid-isbn' );
4040 }
4141 $this->showList();
4242 }
Index: trunk/phase3/includes/specials/SpecialConfirmemail.php
@@ -71,7 +71,7 @@
7272 $wgOut->addWikiMsg( 'emailauthenticated', $time, $d, $t );
7373 }
7474 if( $wgUser->isEmailConfirmationPending() ) {
75 - $wgOut->wrapWikiMsg( "<div class=\"error mw-confirmemail-pending\">$1</div>", 'confirmemail_pending' );
 75+ $wgOut->wrapWikiMsg( "<div class=\"error mw-confirmemail-pending\">\n$1</div>", 'confirmemail_pending' );
7676 }
7777 $wgOut->addWikiMsg( 'confirmemail_text' );
7878 $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getLocalUrl() ) );
Index: trunk/phase3/RELEASE-NOTES
@@ -708,6 +708,7 @@
709709 Improved representation of six quotes (may break existing markup).
710710 * (bug 22034) Use wfClientAcceptsGzip() in wfGzipHandler instead of
711711 reimplementing it.
 712+* (bug 19226) First line renders differently on many UI messages.
712713
713714 == API changes in 1.16 ==
714715
@@ -813,13 +814,13 @@
814815 * Add Estonian letters äöõšüž to linktrail (et)
815816 * (bug 18776) Native name of Burmese language (my)
816817 * (bug 18806) Use correct unicode characters in spelling of native Chuvash
817 - (???????)
 818+ (Чӑвашла)
818819 * (bug 18864) Updated autonym for Zhuang language
819820 * (bug 18308) Updated date formatting in Occitan (oc)
820 -* (bug 19080) Added aâîst??AÂÎST?? to Romanion (ro) linktrail
 821+* (bug 19080) Added ăâîşţșțĂÂÎŞŢȘȚ to Romanion (ro) linktrail
821822 * (bug 19286) Correct commafying function in Polish (pl)
822823 * (bug 19441) Updated date formatting for Lithuanian
823 -* (bug 19630) Added ÄäÇçGgNnÖöSsÜüÝýŽž to Turkmen (tk) linktrail
 824+* (bug 19630) Added ÄäÇçĞğŇňÖöŞşÜüÝýŽž to Turkmen (tk) linktrail
824825 * (bug 19949) New linktrail for Greek (el)
825826 * (bug 19809) Korean (North Korea) (ko-kp) (new)
826827 * (bug 19968) Fixed "Project talk" namespace name for Maltese (mt)
@@ -895,4 +896,4 @@
896897
897898 === IRC help ===
898899
899 -There's usually someone online
\ No newline at end of file
 900+There's usually someone online in #mediawiki on irc.freenode.net

Follow-up revisions

RevisionCommit summaryAuthorDate
r61935Follow-up r61055: prevent "\n" appearing as text.siebrand15:57, 3 February 2010
r64777Fix for r61055: single-quoted strings doesn't replace \n with newlines :)ialex07:16, 9 April 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r61052* (bug 18765) Increased consistency of bold-italic markup for unbalanced quotes....platonides16:18, 14 January 2010

Comments

#Comment by Nikerabbit (talk | contribs)   17:54, 14 January 2010

The screw-up was in r61054. Generally it is not nice to piggy bag unrelated changes, for example is someone wants to revert this particular revision.

Status & tagging log