diff --git a/githooks/update-version-query-strings b/githooks/update-version-query-strings index 7a7a0818a..ab17ecabb 100755 --- a/githooks/update-version-query-strings +++ b/githooks/update-version-query-strings @@ -9,16 +9,14 @@ * post-commit, post-checkout, post-merge, post-rewrite */ -define('SOURCE_FILE', 'index.php'); - function replaceMatch($m) { $hash = md5_file($m[2]); return "${m[1]}=\"/${m[2]}?${hash}\""; } -file_put_contents(SOURCE_FILE, +file_put_contents('index.php', preg_replace_callback('/(src|href)="\/(.*?)\?[a-z0-9]*?"/', 'replaceMatch', - file_get_contents(SOURCE_FILE)) + file_get_contents('index.php.template.txt')) ); diff --git a/index.php b/index.php.template.txt similarity index 80% rename from index.php rename to index.php.template.txt index b693a8f52..d51829031 100644 --- a/index.php +++ b/index.php.template.txt @@ -84,9 +84,9 @@ $serverlibrary = $serverlibs[$serverprotocol]; Showdown! - + - + @@ -174,41 +174,41 @@ $serverlibrary = $serverlibs[$serverprotocol]; - + - - - + + + - - - + + + - + - - - - - - - - + + + + + + + + - + - +