(bug 15737) Fix notices while expanding using PPCustomFrame. Patch by Juliano F....
authorSiebrand Mazeland <siebrand@users.mediawiki.org>
Mon, 3 Nov 2008 00:04:33 +0000 (00:04 +0000)
committerSiebrand Mazeland <siebrand@users.mediawiki.org>
Mon, 3 Nov 2008 00:04:33 +0000 (00:04 +0000)
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_*.

RELEASE-NOTES
includes/parser/Preprocessor_DOM.php
includes/parser/Preprocessor_Hash.php

index ef80d6a..92cb7e9 100644 (file)
@@ -309,7 +309,8 @@ The following extensions are migrated into MediaWiki 1.14:
   of time with CACHE_NONE (default objectcache table configuration).
 * Trying to set two different default category sort keys for one page now produces
   a warning
-* (bug 16143) Fix redirect loop on special pages starting with lower case letters.
+* (bug 16143) Fix redirect loop on special pages starting with lower case letters
+* (bug 15737) Fix notices while expanding using PPCustomFrame
 
 === API changes in 1.14 ===
 
index f0f5a80..af591b6 100644 (file)
@@ -1321,6 +1321,9 @@ class PPCustomFrame_DOM extends PPFrame_DOM {
        }
 
        function getArgument( $index ) {
+               if ( !isset( $this->args[$index] ) ) {
+                       return false;
+               }
                return $this->args[$index];
        }
 }
index 5473286..6202829 100644 (file)
@@ -1274,6 +1274,9 @@ class PPCustomFrame_Hash extends PPFrame_Hash {
        }
 
        function getArgument( $index ) {
+               if ( !isset( $this->args[$index] ) ) {
+                       return false;
+               }
                return $this->args[$index];
        }
 }