http://www.mediawiki.org/wiki/Special:Code/MediaWiki/76178

Revision: 76178
Author:   tparscal
Date:     2010-11-06 00:32:18 +0000 (Sat, 06 Nov 2010)
Log Message:
-----------
Removed the possibility of using the original $data in a template

Modified Paths:
--------------
    trunk/extensions/HtmlUi/classes/HtmlUiTemplate.php

Modified: trunk/extensions/HtmlUi/classes/HtmlUiTemplate.php
===================================================================
--- trunk/extensions/HtmlUi/classes/HtmlUiTemplate.php  2010-11-06 00:23:57 UTC 
(rev 76177)
+++ trunk/extensions/HtmlUi/classes/HtmlUiTemplate.php  2010-11-06 00:32:18 UTC 
(rev 76178)
@@ -46,6 +46,11 @@
        public function render( array $data = array() ) {
                // Expand bindings to vars, just for this scope - escaped by 
default!
                extract( self::escape( $data ) );
+               // If $data had an element keyed as "data", then it's been 
shadowed, otherwise we need to
+               // unset it so the template doesn't start using the unescaped 
$data variable
+               if ( !isset( $data['data'] ) ) {
+                       unset( $data );
+               }
                ob_start();
                require( $this->filePath );
                return ob_get_clean();


_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to