Subversion Repositories vnag

Rev

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

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