r61201 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61200‎ | r61201 | r61202 >
Date:13:54, 18 January 2010
Author:jojo
Status:ok
Tags:
Comment:
escape strings to be output to HTML
Modified paths:
  • /trunk/extensions/Collection/Collection.templates.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Collection/Collection.templates.php
@@ -430,7 +430,7 @@
431431 class CollectionSuggestTemplate extends QuickTemplate {
432432 function execute () {
433433 ?>
434 -<script src="<?php echo $GLOBALS['wgScriptPath'] . "/extensions/Collection/js/jquery.js?" . $GLOBALS['wgCollectionStyleVersion'] ?>" type="<?php echo $GLOBALS['wgJsMimeType']; ?>"></script>
 434+<script src="<?php echo htmlspecialchars($GLOBALS['wgScriptPath'] . "/extensions/Collection/js/jquery.js?" . $GLOBALS['wgCollectionStyleVersion']) ?>" type="<?php echo $GLOBALS['wgJsMimeType']; ?>"></script>
435435 <script type="<?php echo $GLOBALS['wgJsMimeType']; ?>">
436436 /*<![CDATA[*/
437437 var collection_jQuery = jQuery.noConflict();
@@ -494,8 +494,7 @@
495495 $out .= '<noscript><input type="checkbox" value="' . htmlspecialchars($artName) . '" name="articleList[]" /></noscript>';
496496 $out .= '<a onclick="' . htmlspecialchars('collectionSuggestCall("AddArticle", ' . Xml::encodeJsVar(array($artName)) . '); return false;') . '" href="' . htmlspecialchars(SkinTemplate::makeSpecialUrl('Book', array('bookcmd' => 'suggest', 'add' => $artName))) . '" title="' . wfMsgHtml('coll-add_this_page') . '"><img src="' . htmlspecialchars($mediapath . 'silk-add.png') . '" width="16" height="16" alt=""></a> ';
497497 $out .= '<a onclick="' . htmlspecialchars('collectionSuggestCall("BanArticle", ' . Xml::encodeJsVar(array($artName)) . '); return false;') . '" href="' . htmlspecialchars(SkinTemplate::makeSpecialUrl('Book', array('bookcmd' => 'suggest', 'ban' => $artName))) . '" title="' . wfMsgHtml('coll-suggest_ban_tooltip') . '"><img src="' . htmlspecialchars($mediapath . 'silk-cancel.png') . '" width="16" height="16" alt=""></a> ';
498 - $out .= '<a href="' . $url . '" title="' . htmlspecialchars($artName) . '">' . htmlspecialchars($artName) . '</a>';
499 - //$out .= ' ' . $prop[0]['val'];
 498+ $out .= '<a href="' . htmlspecialchars($url) . '" title="' . htmlspecialchars($artName) . '">' . htmlspecialchars($artName) . '</a>';
500499 $out .= '</li>';
501500
502501 for ($i = 1; $i < $num; $i++) {
@@ -506,7 +505,6 @@
507506 $out .= '<noscript><input type="checkbox" value="' . htmlspecialchars($artName) . '" name="articleList[]" /></noscript>';
508507 $out .= '<a onclick="' . htmlspecialchars('collectionSuggestCall("AddArticle", ' . Xml::encodeJsVar(array($artName)) . '); return false;') . '" href="' . htmlspecialchars(SkinTemplate::makeSpecialUrl('Book', array('bookcmd' => 'suggest', 'add' => $artName))) . '" title="' . wfMsgHtml('coll-add_this_page') . '"><img src="' . htmlspecialchars($mediapath . 'silk-add.png') . '" width="16" height="16" alt=""></a> ';
509508 $out .= '<a href="' . htmlspecialchars($url) . '" title="' . htmlspecialchars($artName) . '">' . htmlspecialchars($artName) . '</a>';
510 - //$out .= ' ' . $prop[$i]['val'];
511509 $out .= '</li>';
512510 }
513511
@@ -526,7 +524,7 @@
527525 $artName = $coll['items'][$i]['title'];
528526 if ($coll['items'][$i]['type'] == 'article') {
529527 $out .= '<li><a href="' . htmlspecialchars(SkinTemplate::makeSpecialUrl('Book', array( 'bookcmd' => 'suggest', 'remove' => $artName))) . '" onclick="' . htmlspecialchars('collectionSuggestCall("RemoveArticle", ' . Xml::encodeJsVar(array($artName)) . '); return false;') . '" title="' . wfMsgHtml('coll-remove_this_page') . '"><img src="'.htmlspecialchars($mediapath . 'remove.png').'" width="10" height="10" alt=""></a> ';
530 - $out .= '<a href="' . $coll['items'][$i]['url'] . '" title="' . $artName . '">' . $artName . '</a></li>';
 528+ $out .= '<a href="' . htmlspecialchars($coll['items'][$i]['url']) . '" title="' . htmlspecialchars($artName) . '">' . htmlspecialchars($artName) . '</a></li>';
531529 }
532530 }
533531

Status & tagging log