]> git.wh0rd.org - tt-rss.git/blobdiff - include/functions.php
fix crash on feedlist collapse, do not use _COLLAPSED_FEEDLIST pref
[tt-rss.git] / include / functions.php
index 2f288737ed4b6814ead1331889807107deccacfb..344d66ae1d6843445a763d69ba80430252ee0c57 100644 (file)
                $fp = fopen(LOCK_DIRECTORY . "/$filename", "w");
 
                if ($fp && flock($fp, LOCK_EX | LOCK_NB)) {
+                       $stat_h = fstat($fp);
+                       $stat_f = stat(LOCK_DIRECTORY . "/$filename");
+
+                       if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') {
+                               if ($stat_h["ino"] != $stat_f["ino"] ||
+                                               $stat_h["dev"] != $stat_f["dev"]) {
+
+                                       return false;
+                               }
+                       }
+
                        if (function_exists('posix_getpid')) {
                                fwrite($fp, posix_getpid() . "\n");
                        }
                $params["max_feed_id"] = (int) $max_feed_id;
                $params["num_feeds"] = (int) $num_feeds;
 
-               $params["collapsed_feedlist"] = (int) get_pref("_COLLAPSED_FEEDLIST");
                $params["hotkeys"] = get_hotkeys_map();
 
                $params["csrf_token"] = $_SESSION["csrf_token"];