r114683 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114682‎ | r114683 | r114684 >
Date:17:53, 3 April 2012
Author:reedy
Status:ok
Tags:
Comment:
Bug 35673 - XSS vulnerability in mobile search
Modified paths:
  • /branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/SearchTemplate.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.19wmf1/extensions/MobileFrontend/templates/SearchTemplate.php
@@ -8,14 +8,14 @@
99
1010 public function getHTML() {
1111
12 - $searchField = Xml::escapeJsString( $this->data['searchField'] );
 12+ $searchField = Sanitizer::encodeAttribute( $this->data['searchField'] );
1313 $mainPageUrl = $this->data['mainPageUrl'];
1414 $randomPageUrl = $this->data['randomPageUrl'];
1515 $homeButton = $this->data['messages']['mobile-frontend-home-button'];
1616 $randomButton = $this->data['messages']['mobile-frontend-random-button'];
17 - $clearText = Xml::escapeJsString( $this->data['messages']['mobile-frontend-clear-search'] );
 17+ $clearText = Sanitizer::encodeAttribute( $this->data['messages']['mobile-frontend-clear-search'] );
1818 $searchValue = $this->data['messages']['mobile-frontend-search-submit'];
19 - $placeholder = Xml::escapeJsString( $this->data['messages']['mobile-frontend-placeholder'] );
 19+ $placeholder = Sanitizer::encodeAttribute( $this->data['messages']['mobile-frontend-placeholder'] );
2020
2121 $scriptUrl = wfScript();
2222 $searchBoxDisplayNone = ( $this->data['hideSearchBox'] ) ? ' style="display: none;" ' : '';

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r114191htmlspecialchars -> Xml::escapeJsStringawjrichards21:37, 19 March 2012

Status & tagging log