r63738 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63737‎ | r63738 | r63739 >
Date:13:18, 14 March 2010
Author:happydog
Status:ok
Tags:
Comment:
CodeReview: Fixed up r62933 as per NikeRabbit's suggestions (http://www.mediawiki.org/wiki/Special:Code/MediaWiki/62933#c6007):

* Use $wgOut->addWikiMsg() instead of $wgOut->addHtml()
* Escape $param[0] using wfEscapeWikiText() to stop HTML injection
* Add description of the 'code-repo-not-found' message to the 'qqq' array.

I also added a description for 'code-rev-id', which I added in r62934. I am aware that this message is ignored at translate-wiki (as per r62935) but I thought it best to provide a description in any case.
Modified paths:
  • /trunk/extensions/CodeReview/CodeReview.i18n.php (modified) (history)
  • /trunk/extensions/CodeReview/ui/SpecialCode.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/CodeReview.i18n.php
@@ -194,6 +194,7 @@
195195 'code-field-comments' => '{{Identical|Notes}}',
196196 'code-field-path' => '{{Identical|Path}}',
197197 'code-field-select' => '{{Identical|Select}}',
 198+ 'code-rev-id' => 'Modify the raw numeric revision ID (which is in $1) to the standard display format (rNNN). This probably shouldn\'t be localised as the hot-linking within comments only recognises rNNN and having another representation of this in the interface will cause confusion. In all other messages which take a revision ID as a parameter, the revision ID will already have been expanded using this message, so you should not include the \'r\' in the message itself.',
198199 'code-rev-author' => '{{Identical|Author}}',
199200 'code-rev-date' => '{{Identical|Date}}',
200201 'code-rev-message' => '{{Identical|Comment}}',
@@ -235,6 +236,7 @@
236237 'codereview-email-body3' => '* <code>$1</code> – Number of the revision where a regression has been introduced
237238 * <code>$2</code> – URL to the revision
238239 * <code>$3</code> – Commit message for the revision',
 240+ 'code-repo-not-found' => 'Message displayed when the requested repository does not exist in the wiki\'s repo definitions. $1 is the name that was requested, and will be fully escaped before output.',
239241 'repoadmin-new-button' => '{{Identical|Create}}',
240242 'repoadmin-edit-button' => '{{Identical|OK}}',
241243 'right-repoadmin' => '{{doc-right}}',
Index: trunk/extensions/CodeReview/ui/SpecialCode.php
@@ -96,9 +96,7 @@
9797 // repository list with an appropriate message.
9898 if ( !$view->mRepo ) {
9999 $view = new CodeRepoListView();
100 - $wgOut->addHTML( "<p>"
101 - . wfMsg( 'code-repo-not-found', $params[0] )
102 - . "</p>" );
 100+ $wgOut->addWikiMsg( 'code-repo-not-found', wfEscapeWikiText( $params[0] ) );
103101 }
104102 }
105103 $view->execute();

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r62933CodeReview: Added some code to redirect to the repository list with an error ...happydog17:47, 24 February 2010
r62934CodeReview: Modified the method we use to output the revision ID. If more th...happydog18:50, 24 February 2010
r62935Follow-up r62934: Ignore message for translatewikiraymond18:59, 24 February 2010

Status & tagging log