From 8683c11bb03498aa25a3cad2715497f82f7fb9c5 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 1 Oct 2011 02:03:05 +0000 Subject: [PATCH] * (bug 31289) Fix fatal error on special pages using $this->msg() on PHP 5.2 According to online PHP docs, func_get_args() doesn't work in function parameter lists until PHP 5.3.0. It does, however, work as the *first* parameter, which happens here and there in older code (eg array_slice(func_get_args(),1)). Assigning to a variable and passing through works fine for this case on PHP 5.2.17. --- includes/SpecialPage.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php index 872a493734..77fecd9a17 100644 --- a/includes/SpecialPage.php +++ b/includes/SpecialPage.php @@ -681,7 +681,12 @@ class SpecialPage { * @see wfMessage */ public function msg( /* $args */ ) { - return call_user_func_array( array( $this->getContext(), 'msg' ), func_get_args() ); + // Note: can't use func_get_args() directly as second or later item in + // a parameter list until PHP 5.3 or you get a fatal error. + // Works fine as the first parameter, which appears elsewhere in the + // code base. Sighhhh. + $args = func_get_args(); + return call_user_func_array( array( $this->getContext(), 'msg' ), $args ); } /** -- 2.20.1