]> git.wh0rd.org - tt-rss.git/blobdiff - include/version.php
minor css fixes (mostly for zoom mode)
[tt-rss.git] / include / version.php
index 71cf3dc75a6c0adfd8a777018a198b3225b12d79..e5f91bd9cf9ce0411a7561debab14ab9593a6c6f 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-       define('VERSION_STATIC', '16.1');
+       define('VERSION_STATIC', '18.12');
 
        function get_version() {
                date_default_timezone_set('UTC');
@@ -14,6 +14,8 @@
                                if (preg_match("/^ref: (.*)/", $head, $matches)) {
                                        $ref = $matches[1];
 
+                                       if (!file_exists("$root_dir/.git/$ref"))
+                                               return VERSION_STATIC;
                                        $suffix = substr(trim(file_get_contents("$root_dir/.git/$ref")), 0, 7);
                                        $timestamp = filemtime("$root_dir/.git/$ref");
 
@@ -23,7 +25,7 @@
                                        return VERSION_STATIC . " ($suffix)";
 
                                } else {
-                                       $suffix = trim($head, 0, 7);
+                                       $suffix = substr(trim($head), 0, 7);
                                        $timestamp = filemtime("$root_dir/.git/HEAD");
 
                                        define("GIT_VERSION_HEAD", $suffix);
@@ -39,4 +41,3 @@
        }
 
        define('VERSION', get_version());
-?>