summaryrefslogtreecommitdiff
path: root/functions.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2006-08-30 04:57:20 +0100
committerAndrew Dolgov <[email protected]>2006-08-30 04:57:20 +0100
commita41d2c65a08d184badcedeed3f85e1d6aff478c3 (patch)
tree03aaadad3ae5c1397a0e835b041d2cf17fbd5959 /functions.php
parentdade09adb0ca8022c30d692b3c3faca7436b47e3 (diff)
better new version detection
Diffstat (limited to 'functions.php')
-rw-r--r--functions.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/functions.php b/functions.php
index a80c5bda3..25b7dff76 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 "<div class=\"notice\"><a href=\"javascript:showBlockElement('milestoneDetails')\">
- New version of Tiny-Tiny RSS ($last_version) is available (click for details)</a>
+ New version of Tiny-Tiny RSS ($latest_version) is available (click for details)</a>
<div id=\"milestoneDetails\">$content</div></div>";
}
}