r107511 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107510‎ | r107511 | r107512 >
Date:19:25, 28 December 2011
Author:catrope
Status:ok
Tags:
Comment:
For paranoia, cast $item->getProperty( 'id' ) to an integer before injecting it into HTML
Modified paths:
  • /trunk/extensions/MoodBar/ApiFeedbackDashboardResponse.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MoodBar/ApiFeedbackDashboardResponse.php
@@ -46,14 +46,15 @@
4747
4848 $this->disableUserTalkEmailNotification();
4949
 50+ $id = intval( $item->getProperty( 'id' ) );
5051 $api = new ApiMain( new FauxRequest( array(
5152 'action' => 'edit',
5253 'title' => $talkPage->getFullText(),
5354 'appendtext' => ( $talkPage->exists() ? "\n\n" : '' ) .
5455 $feedback_link . "\n" .
55 - '<span id="feedback-dashboard-response-' . $item->getProperty('id') . '"></span>' . "\n\n" .
 56+ '<span id="feedback-dashboard-response-' . $id . '"></span>' . "\n\n" .
5657 $response . "\n\n~~~~\n\n" .
57 - '<span class="markashelpful-item" data-markashelpful-item="' . $item->getProperty('id') . '" data-markashelpful-type="mbresponse"></span>',
 58+ '<span class="markashelpful-item" data-markashelpful-item="' . $id . '" data-markashelpful-type="mbresponse"></span>',
5859 'token' => $params['token'],
5960 'summary' => $summary,
6061 'notminor' => true,

Status & tagging log