Skip to content

Commit e7f9f69

Browse files
committed
release tag filter added
1 parent 11c311c commit e7f9f69

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

includes/PDUpdater.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,9 @@ public function modify_transient($transient)
9797
if ($checked = $transient->checked) {
9898
$this->get_repository_info();
9999

100-
$out_of_date = version_compare($this->github_response['tag_name'], $checked[$this->basename], 'gt');
100+
$tag_name = str_replace("v", "", $this->github_response['tag_name']);
101+
$tag_name = str_replace("V", "", $tag_name);
102+
$out_of_date = version_compare($tag_name, $checked[$this->basename], 'gt');
101103

102104
if ($out_of_date) {
103105
$new_files = $this->github_response['zipball_url'];
@@ -107,7 +109,7 @@ public function modify_transient($transient)
107109
'url' => $this->plugin['PluginURI'],
108110
'slug' => $slug,
109111
'package' => $new_files,
110-
'new_version' => $this->github_response['tag_name']
112+
'new_version' => $tag_name
111113
];
112114

113115
$transient->response[$this->basename] = (object) $plugin;
@@ -127,12 +129,16 @@ public function plugin_popup($result, $action, $args)
127129
if ($args->slug == current(explode('/', $this->basename))) {
128130
$this->get_repository_info();
129131
$slug = current(explode('/', $this->basename));
132+
133+
$tag_name = str_replace("v", "", $this->github_response['tag_name']);
134+
$tag_name = str_replace("V", "", $tag_name);
135+
130136
$plugin = [
131137
'name' => isset($this->plugin['Name']) ? $this->plugin['Name'] : '',
132138
'slug' => $slug,
133139
'requires' => '5.3',
134140
'tested' => '5.4',
135-
'version' => $this->github_response['tag_name'],
141+
'version' => $tag_name,
136142
'author' => $this->plugin['Author'],
137143
'author_profile' => $this->plugin['AuthorURI'],
138144
'last_updated' => $this->github_response['published_at'],

0 commit comments

Comments
 (0)