From: Mukunda Modell Date: Wed, 22 Apr 2015 22:34:25 +0000 (-0500) Subject: require_once instead of depending on the return value of include_once X-Git-Tag: 1.31.0-rc.0~11615 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=7959f93c30e4b845ea8f4f5d2262b30b8a89c980;p=lhc%2Fweb%2Fwiklou.git require_once instead of depending on the return value of include_once return value from include_once is unreliable, it could be the value of a 'return;' statement in the included file, or it could be false when the file wasn't readable. This was breaking deployments because one of the extensions had "return;" which caused include_once to return a falsy value. Change-Id: I48b9a55d5f9e85efe515d87b56b60ee71f939842 --- diff --git a/maintenance/mergeMessageFileList.php b/maintenance/mergeMessageFileList.php index 43fa4603f4..b4914971ab 100644 --- a/maintenance/mergeMessageFileList.php +++ b/maintenance/mergeMessageFileList.php @@ -173,10 +173,8 @@ foreach ( $mmfl['setupFiles'] as $fileName ) { // Using extension.json or skin.json if ( substr( $fileName, -strlen( '.json' ) ) === '.json' ) { $queue[$fileName] = 1; - } elseif ( !( include_once $fileName ) ) { - // Include the extension to update $wgExtensionMessagesFiles - fwrite( STDERR, "Unable to read $fileName\n" ); - exit( 1 ); + } else { + require_once $fileName; } }