mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-09-30 23:01:05 -05:00
Change version script for PHP 5.2
The live web server runs PHP 5.2, which apparently does not support anonymous functions, so the anonymous funciton has been removed from update-version-query-strings.
This commit is contained in:
@@ -11,11 +11,14 @@
|
||||
|
||||
define('SOURCE_FILE', 'index.php');
|
||||
|
||||
function replaceMatch($m) {
|
||||
$hash = md5_file($m[2]);
|
||||
return "${m[1]}=\"/${m[2]}?${hash}\"";
|
||||
}
|
||||
|
||||
file_put_contents(SOURCE_FILE,
|
||||
preg_replace_callback('/(src|href)="\/(.*?)\?[a-z0-9]*?"/',
|
||||
function($m) {
|
||||
$hash = md5_file($m[2]);
|
||||
return "${m[1]}=\"/${m[2]}?${hash}\"";
|
||||
},
|
||||
file_get_contents(SOURCE_FILE)));
|
||||
'replaceMatch',
|
||||
file_get_contents(SOURCE_FILE))
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user