From b8dee03d9e6337031e5f118d46183a3a63e77b0c Mon Sep 17 00:00:00 2001 From: Max Semenik Date: Thu, 19 Jul 2018 23:54:49 -0700 Subject: [PATCH] GlobalFunctions: use a closure instead of polluting global namespace Change-Id: Ia587008de75a8bde90ad45d4932284f0b6401845 --- includes/GlobalFunctions.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index afad5c468b..eec4216468 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -866,20 +866,13 @@ function wfParseUrl( $url ) { function wfExpandIRI( $url ) { return preg_replace_callback( '/((?:%[89A-F][0-9A-F])+)/i', - 'wfExpandIRI_callback', + function ( array $matches ) { + return urldecode( $matches[1] ); + }, wfExpandUrl( $url ) ); } -/** - * Private callback for wfExpandIRI - * @param array $matches - * @return string - */ -function wfExpandIRI_callback( $matches ) { - return urldecode( $matches[1] ); -} - /** * Make URL indexes, appropriate for the el_index field of externallinks. * -- 2.20.1