r96352 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96351‎ | r96352 | r96353 >
Date:17:12, 6 September 2011
Author:preilly
Status:resolved (Comments)
Tags:
Comment:
fix for r96167 title hack
Modified paths:
  • /trunk/extensions/MobileFrontend/MobileFrontend.i18n.php (modified) (history)
  • /trunk/extensions/MobileFrontend/MobileFrontend.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/MobileFrontend.i18n.php
@@ -59,7 +59,7 @@
6060 'mobile-frontend-featured-article' => 'Today\'s Featured Article',
6161 'mobile-frontend-news-items' => 'In The News',
6262 'mobile-frontend-leave-feedback-title' => 'Leave feedback about Mobile Frontend',
63 - 'mobile-frontend-leave-feedback-notice' => 'Your feedback will be posted publicly, along with your user name, browser version and operating system to the page $1',
 63+ 'mobile-frontend-leave-feedback-notice' => 'Your feedback will be posted publicly, along with your user name, browser version and operating system to the page "$1"',
6464 'mobile-frontend-leave-feedback-subject' => 'Subject',
6565 'mobile-frontend-leave-feedback-message' => 'Message',
6666 'mobile-frontend-leave-feedback-cancel' => 'Cancel',
Index: trunk/extensions/MobileFrontend/MobileFrontend.php
@@ -65,7 +65,7 @@
6666 );
6767
6868 class ExtMobileFrontend {
69 - const VERSION = '0.5.54';
 69+ const VERSION = '0.5.55';
7070
7171 /**
7272 * @var DOMDocument
@@ -208,9 +208,8 @@
209209 foreach ( self::$messageKeys as $messageKey ) {
210210
211211 if ( $messageKey == 'mobile-frontend-leave-feedback-notice' ) {
212 - $scriptUrl = wfScript();
213212 $linkText = wfMsg( 'mobile-frontend-leave-feedback-link-text' );
214 - self::$messages[$messageKey] = wfMsg( $messageKey, "&quot;<a href=\"{$scriptUrl}?title=MobileFrontend_Extension_Feedback\" target=\"_blank\">{$linkText}</a>&quot;" );
 213+ self::$messages[$messageKey] = wfMsg( $messageKey, Html::element( 'a', array( 'href' => Title::newFromText( 'MobileFrontend Extension Feedback' )->getFullURL(), 'target' => '_blank' ), $linkText ) );
215214 } else {
216215 self::$messages[$messageKey] = wfMsg( $messageKey );
217216 }
@@ -491,7 +490,6 @@
492491
493492 $title = self::$messages['mobile-frontend-leave-feedback-title'];
494493 $notice = self::$messages['mobile-frontend-leave-feedback-notice'];
495 - $linkText = self::$messages['mobile-frontend-leave-feedback-link-text'];
496494 $subject = self::$messages['mobile-frontend-leave-feedback-subject'];
497495 $message = self::$messages['mobile-frontend-leave-feedback-message'];
498496 $cancel = self::$messages['mobile-frontend-leave-feedback-cancel'];

Follow-up revisions

RevisionCommit summaryAuthorDate
r96371fix for r96352preilly20:52, 6 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r96167add page link as $1 in feedback notice messagepreilly00:37, 3 September 2011

Comments

#Comment by 😂 (talk | contribs)   20:01, 6 September 2011

Couple of notes:

  • By using wfMsg(), you'll be replacing the link into the message before transforming it, and you'll mangle the link. You should use wfMsgExt( $key, 'replaceafter', $link ) like I suggested before.
  • Rather than doing <a> by hand, you should use Linker::link()
    • Also with the link: are you sure "MobileFrontend Extension Feedback" is a valid page on all wikis? It would make sense to make this configurable per-language in a msg (like 'mobile-frontend-feedback-page' => 'Project:Mobile Extension Feedback' with a wfMsgNoTrans())
#Comment by Preilly (talk | contribs)   20:53, 6 September 2011

This should now be fixed in r96371.

Status & tagging log