]> git.wh0rd.org Git - tt-rss.git/commitdiff
validate_session: check for schema version
authorAndrew Dolgov <fox@bah.org.ru>
Wed, 13 Jan 2010 19:25:03 +0000 (22:25 +0300)
committerAndrew Dolgov <fox@bah.org.ru>
Wed, 13 Jan 2010 19:25:03 +0000 (22:25 +0300)
functions.php

index 3d09e0f6913e1dc59c4d5d203db3400fed6d05ef..1276146c36899defb46128c0fb586c9c6654a6a8 100644 (file)
                        }
                }
 
+               if ($_SESSION["ref_schema_version"] != get_schema_version($link, true)) {
+                       return false;
+               }
+
                if ($_SESSION["uid"]) {
 
                        $result = db_query($link, 
                                        $_POST["password"] = "";
 
                                        $_SESSION["language"] = $_POST["language"];
+                                       $_SESSION["ref_schema_version"] = get_schema_version($link, true);
                                        $_SESSION["bw_limit"] = !!$_POST["bw_limit"];
 
                                        if ($_POST["profile"]) {
                error_reporting(0);
 
                $error_code = 0;
-               $result = db_query($link, "SELECT schema_version FROM ttrss_version");
-               $schema_version = db_fetch_result($result, 0, "schema_version");
+               $schema_version = get_schema_version($link);
 
                if ($schema_version != SCHEMA_VERSION) {
                        $error_code = 5;