r76178 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76177‎ | r76178 | r76179 >
Date:00:32, 6 November 2010
Author:tparscal
Status:deferred
Tags:
Comment:
Removed the possibility of using the original $data in a template
Modified paths:
  • /trunk/extensions/HtmlUi/classes/HtmlUiTemplate.php (modified) (history)

Diff [purge]

Index: trunk/extensions/HtmlUi/classes/HtmlUiTemplate.php
@@ -46,6 +46,11 @@
4747 public function render( array $data = array() ) {
4848 // Expand bindings to vars, just for this scope - escaped by default!
4949 extract( self::escape( $data ) );
 50+ // If $data had an element keyed as "data", then it's been shadowed, otherwise we need to
 51+ // unset it so the template doesn't start using the unescaped $data variable
 52+ if ( !isset( $data['data'] ) ) {
 53+ unset( $data );
 54+ }
5055 ob_start();
5156 require( $this->filePath );
5257 return ob_get_clean();

Status & tagging log