From 792172840a33988480e5377f4b44f6f691171714 Mon Sep 17 00:00:00 2001 From: Siebrand Mazeland Date: Mon, 3 Nov 2008 00:04:33 +0000 Subject: [PATCH] (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_*. --- RELEASE-NOTES | 3 ++- includes/parser/Preprocessor_DOM.php | 3 +++ includes/parser/Preprocessor_Hash.php | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) 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]; } } -- 2.20.1