From: victorbarbu Date: Sat, 9 Jan 2016 19:27:54 +0000 (+0200) Subject: convertExtensionToRegistration.php: die on global functions X-Git-Tag: 1.31.0-rc.0~8386 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/comptes/ajouter.php?a=commitdiff_plain;h=3a7d5067c72a6b50355fc752681bfb69714421b5;p=lhc%2Fweb%2Fwiklou.git convertExtensionToRegistration.php: die on global functions Bug: T122952 Change-Id: I0fca5457aba3a7237ad7aeb96f3f6636d73863d3 --- diff --git a/maintenance/convertExtensionToRegistration.php b/maintenance/convertExtensionToRegistration.php index 2de2e222c1..3113533711 100644 --- a/maintenance/convertExtensionToRegistration.php +++ b/maintenance/convertExtensionToRegistration.php @@ -151,6 +151,12 @@ class ConvertExtensionToRegistration extends Maintenance { "Please move your extension function somewhere else.", 1 ); } + // check if $func exists in the global scope + if ( function_exists( $func ) ) { + $this->error( "Error: Global functions cannot be converted to JSON. " . + "Please move your extension function ($func) into a class.", 1 + ); + } } $this->json[$realName] = $value; @@ -217,6 +223,12 @@ class ConvertExtensionToRegistration extends Maintenance { "Please move the handler for $hookName somewhere else.", 1 ); } + // Check if $func exists in the global scope + if ( function_exists( $func ) ) { + $this->error( "Error: Global functions cannot be converted to JSON. " . + "Please move the handler for $hookName inside a class.", 1 + ); + } } } $this->json[$realName] = $value;