From: Andrew Dolgov Date: Wed, 30 Aug 2006 03:57:20 +0000 (+0100) Subject: better new version detection X-Git-Tag: 1.2.3~23 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=a41d2c65a08d184badcedeed3f85e1d6aff478c3;p=tt-rss.git better new version detection --- diff --git a/functions.php b/functions.php index a80c5bda..25b7dff7 100644 --- a/functions.php +++ b/functions.php @@ -2570,17 +2570,16 @@ return; } - $last_item = $items[0]; + $latest_item = $items[0]; - $last_version = trim(preg_replace("/(Milestone)|(completed)/", "", $last_item["title"])); - $cur_version = preg_replace("/\.99/", "", VERSION); + $latest_version = trim(preg_replace("/(Milestone)|(completed)/", "", $latest_item["title"])); $release_url = sanitize_rss($last_item["link"]); $content = sanitize_rss($last_item["description"]); - if ($cur_version != $last_version) { + if (version_compare(VERSION, $latest_version) == -1) { return "
- New version of Tiny-Tiny RSS ($last_version) is available (click for details) + New version of Tiny-Tiny RSS ($latest_version) is available (click for details)
$content
"; } }