From: Siebrand Mazeland Date: Mon, 3 Nov 2008 00:04:33 +0000 (+0000) Subject: (bug 15737) Fix notices while expanding using PPCustomFrame. Patch by Juliano F.... X-Git-Tag: 1.31.0-rc.0~44455 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=792172840a33988480e5377f4b44f6f691171714;p=lhc%2Fweb%2Fwiklou.git (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_*. --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index ef80d6a8a1..92cb7e9833 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -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 === diff --git a/includes/parser/Preprocessor_DOM.php b/includes/parser/Preprocessor_DOM.php index f0f5a8061b..af591b67d2 100644 --- a/includes/parser/Preprocessor_DOM.php +++ b/includes/parser/Preprocessor_DOM.php @@ -1321,6 +1321,9 @@ class PPCustomFrame_DOM extends PPFrame_DOM { } function getArgument( $index ) { + if ( !isset( $this->args[$index] ) ) { + return false; + } return $this->args[$index]; } } diff --git a/includes/parser/Preprocessor_Hash.php b/includes/parser/Preprocessor_Hash.php index 5473286e85..620282914d 100644 --- a/includes/parser/Preprocessor_Hash.php +++ b/includes/parser/Preprocessor_Hash.php @@ -1274,6 +1274,9 @@ class PPCustomFrame_Hash extends PPFrame_Hash { } function getArgument( $index ) { + if ( !isset( $this->args[$index] ) ) { + return false; + } return $this->args[$index]; } }