summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2008-10-30 03:58:11 +0000
committerScott Ullrich <sullrich@pfsense.org>2008-10-30 03:58:11 +0000
commit57fe6d53c55ddb42bfc1092fe0ae35305e3648bf (patch)
tree7f01b267a5b4f8993464fa50a5477dba05f9bdea /usr
parentbb7f2c3fcd464b23652dbb24ddecb21728340fc4 (diff)
downloadpfsense-57fe6d53c55ddb42bfc1092fe0ae35305e3648bf.zip
pfsense-57fe6d53c55ddb42bfc1092fe0ae35305e3648bf.tar.gz
Check maximum version correctly when dashes are present
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/pkg_mgr.php18
1 files changed, 11 insertions, 7 deletions
diff --git a/usr/local/www/pkg_mgr.php b/usr/local/www/pkg_mgr.php
index 09c7f5b..0556339 100755
--- a/usr/local/www/pkg_mgr.php
+++ b/usr/local/www/pkg_mgr.php
@@ -74,10 +74,10 @@ include("head.inc");
<td>
<?php
$version = file_get_contents("/etc/version");
- $dot = strpos($version, ".");
+ $dash = strpos($version, ".");
$hyphen = strpos($version, "-");
- $major = substr($version, 0, $dot);
- $minor = substr($version, $dot + 1, $hyphen - $dot - 1);
+ $major = substr($version, 0, $dash);
+ $minor = substr($version, $dash + 1, $hyphen - $dash - 1);
$testing_version = substr($version, $hyphen + 1, strlen($version) - $hyphen);
$tab_array = array();
@@ -106,6 +106,8 @@ include("head.inc");
echo "<tr><td colspan=\"5\"><center>There are currently no packages available for installation.</td></tr>";
} else {
$installed_pfsense_version = rtrim(file_get_contents("/etc/version"));
+ $dash = strpos($installed_pfsense_version, "-");
+ $installed_pfsense_version = substr($installed_pfsense_version, 0, $dash);
$pkgs = array();
$instpkgs = array();
if($config['installedpackages']['package'] != "")
@@ -118,10 +120,10 @@ include("head.inc");
if(count($pkg_keys) != 0) {
foreach($pkg_keys as $key) {
$index = &$pkg_info[$key];
- if(in_array($index['name'], $instpkgs)) continue;
- $dot = strpos($index['required_version'], ".");
- $index['major_version'] = substr($index['required_version'], 0, $dot);
-
+ if(in_array($index['name'], $instpkgs))
+ continue;
+ $dash = strpos($index['required_version'], "-");
+ $index['major_version'] = substr($index['required_version'], 0, $dash);
if ($version <> "HEAD" &&
$index['required_version'] == "HEAD" &&
$requested_version <> "other")
@@ -173,6 +175,8 @@ include("head.inc");
<?= $index['version'] ?>
<br/>
platform: <?= $index['required_version'] ?>
+ <br/>
+ <?= $index['maximum_version']; ?>
</td>
<td class="listr">
<a href='http://forum.pfsense.org/index.php/board,15.0.html'>pfSense forums</a>
OpenPOWER on IntegriCloud