Subversion Repositories vnag

Rev

Rev 80 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 80 Rev 88
Line 52... Line 52...
52
                if ($cont === false) {
52
                if ($cont === false) {
53
                        throw new VNagException('Cannot parse version from GitHub API. The plugin probably needs to be updated. (Cannot access api.github.com)');
53
                        throw new VNagException('Cannot parse version from GitHub API. The plugin probably needs to be updated. (Cannot access api.github.com)');
54
                }
54
                }
55
 
55
 
56
                $data = @json_decode($cont, true);
56
                $data = @json_decode($cont, true);
57
                if ($data === false) {
57
                if ($data === null) {
58
                        throw new VNagException('Cannot parse version from GitHub API. The plugin probably needs to be updated. (Invalid JSON data downloaded from api.github.com)');
58
                        throw new VNagException('Cannot parse version from GitHub API. The plugin probably needs to be updated. (Invalid JSON data downloaded from api.github.com)');
59
                }
59
                }
60
 
60
 
61
                return $data['tag_name']; // e.g. "1.2.1"
61
                return $data['tag_name']; // e.g. "1.2.1"
62
        }
62
        }