prefer get parameter for apache redirects
[sc2-widget] / widget.php
index d1b3b88b960c9e262245ad523552a680ebf24169..c99611140d654aca1a66b0add7a697e63d0c7a9b 100644 (file)
@@ -17,9 +17,9 @@ function error($message, $status = 500)
        exit;
 }
 
-$request = trim($_SERVER['PATH_INFO'], '/');
+$request = trim($_GET['clan'] ?? $_SERVER['PATH_INFO'], '/');
 $target = "data/$request.json";
-$last = file_exists($target) ? filemtime($target) : 0;
+$last = file_exists($target) ? lstat($target)['mtime'] : 0;
 
 if ($last < time() - 3600) {
        $recipe = NULL;