Skip to content

Commit bec9027

Browse files
committed
Properly compare versions for updater
1 parent 7d8cddb commit bec9027

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

carpenter.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ function __construct() {
1616
include_once('core/taxonomy.cls.php');
1717
include_once('core/carpenter.cls.php');
1818
include_once('core/updater.cls.php');
19-
}
20-
}
2119

22-
if ( is_admin() ) {
23-
// Check for Update on GitHub
24-
new CarpenterUpdater( __FILE__, 'apsislabs', 'carpenter' );
20+
if ( is_admin() ) {
21+
// Check for Update on GitHub
22+
new CarpenterUpdater( __FILE__, 'apsislabs', 'carpenter' );
23+
}
24+
}
2525
}
2626

2727
new aps_carpenter();

core/updater.cls.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ public function setTransitent($transient) {
5555
$this->initPluginData();
5656
$this->getRepoReleaseInfo();
5757

58-
$doUpdate = version_compare($this->githubAPIResult->tag_name, $transient->checked[$this->slug]);
58+
// Check if Update Needed
59+
$doUpdate = version_compare($this->githubAPIResult->tag_name, $transient->checked[$this->slug], '>');
5960

6061
if ($doUpdate) {
6162
$package = $this->githubAPIResult->zipball_url;

0 commit comments

Comments
 (0)