r97976 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r97975‎ | r97976 | r97977 >
Date:23:25, 23 September 2011
Author:catrope
Status:ok
Tags:
Comment:
Special:MoodBarFeedback: set the right URL for the "What is this feature?" link, and escape the permalink URLs
Modified paths:
  • /trunk/extensions/MoodBar/SpecialMoodBarFeedback.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MoodBar/SpecialMoodBarFeedback.php
@@ -33,7 +33,7 @@
3434 }
3535
3636 public function buildForm() {
37 - global $wgRequest;
 37+ global $wgRequest, $wgMoodBarConfig;
3838 $filtersMsg = wfMessage( 'moodbar-feedback-filters' )->escaped();
3939 $typeMsg = wfMessage( 'moodbar-feedback-filters-type' )->escaped();
4040 $praiseMsg = wfMessage( 'moodbar-feedback-filters-type-happy' )->escaped();
@@ -42,6 +42,7 @@
4343 $usernameMsg = wfMessage( 'moodbar-feedback-filters-username' )->escaped();
4444 $setFiltersMsg = wfMessage( 'moodbar-feedback-filters-button' )->escaped();
4545 $whatIsMsg = wfMessage( 'moodbar-feedback-whatis' )->escaped();
 46+ $whatIsURL = htmlspecialchars( $wgMoodBarConfig['infoUrl'] );
4647
4748 $types = $wgRequest->getArray( 'type' );
4849 $happyCheckbox = Xml::check( 'type[]', in_array( 'happy', $types ),
@@ -78,7 +79,7 @@
7980 $usernameTextbox
8081 <button type="submit" id="fbd-filters-set">$setFiltersMsg</button>
8182 </form>
82 - <a href="#" id="fbd-about">$whatIsMsg</a>
 83+ <a href="$whatIsURL" id="fbd-about">$whatIsMsg</a>
8384 </div>
8485 HTML;
8586 }
@@ -97,7 +98,7 @@
9899 $username = htmlspecialchars( $row->user_name === null ? $row->mbf_user_ip : $row->user_name );
99100 $links = Linker::userToolLinks( $row->mbf_user_id, $username );
100101 $comment = htmlspecialchars( $row->mbf_comment );
101 - $permalinkURL = $this->getTitle( $row->mbf_id )->getLinkURL();
 102+ $permalinkURL = htmlspecialchars( $this->getTitle( $row->mbf_id )->getLinkURL() );
102103 $permalinkText = wfMessage( 'moodbar-feedback-permalink' )->escaped();
103104
104105 $list .= <<<HTML

Status & tagging log