r43105 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43104‎ | r43105 | r43106 >
Date:00:04, 3 November 2008
Author:siebrand
Status:old
Tags:
Comment:
(bug 15737) Fix notices while expanding using PPCustomFrame. Patch by Juliano F. Ravasi.

In PPCustomFrame_DOM and PPCustomFrame_Hash, no checking is performed in getArgument() when arguments not contained in frames are requested, causing PHP undefined variable error messages. This happens while expanding templates using a custom frame.

A simple check is needed using isset(), just like those found in PPFrame_* and PPTemplateFrame_*.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/parser/Preprocessor_DOM.php (modified) (history)
  • /trunk/phase3/includes/parser/Preprocessor_Hash.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/Preprocessor_Hash.php
@@ -1274,6 +1274,9 @@
12751275 }
12761276
12771277 function getArgument( $index ) {
 1278+ if ( !isset( $this->args[$index] ) ) {
 1279+ return false;
 1280+ }
12781281 return $this->args[$index];
12791282 }
12801283 }
Index: trunk/phase3/includes/parser/Preprocessor_DOM.php
@@ -1321,6 +1321,9 @@
13221322 }
13231323
13241324 function getArgument( $index ) {
 1325+ if ( !isset( $this->args[$index] ) ) {
 1326+ return false;
 1327+ }
13251328 return $this->args[$index];
13261329 }
13271330 }
Index: trunk/phase3/RELEASE-NOTES
@@ -309,7 +309,8 @@
310310 of time with CACHE_NONE (default objectcache table configuration).
311311 * Trying to set two different default category sort keys for one page now produces
312312 a warning
313 -* (bug 16143) Fix redirect loop on special pages starting with lower case letters.
 313+* (bug 16143) Fix redirect loop on special pages starting with lower case letters
 314+* (bug 15737) Fix notices while expanding using PPCustomFrame
314315
315316 === API changes in 1.14 ===
316317

Status & tagging log