Skip to content
This repository has been archived by the owner on Aug 1, 2019. It is now read-only.

Commit

Permalink
deal correctly with "empty responses" from VT
Browse files Browse the repository at this point in the history
  • Loading branch information
IzzySoft committed Oct 29, 2018
1 parent b75ab36 commit 53e947b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions virustotal.class.php
Expand Up @@ -39,7 +39,7 @@ class virustotal {
* * response_code (int), verbose_msg (str)
* * also hashes/identifiers: sha256, sha1, md5, scan_id, resource
*/
protected $json_response = [];
public $json_response = [];

/** ScanID we can use to query the state for this file
* @class virustotal
Expand Down Expand Up @@ -95,7 +95,7 @@ function rescan($hash,$maxage=7) {
curl_close ($ch);

$reply = json_decode($api_reply);
if ( property_exists($reply,'response_code') ) {
if ( is_object($reply) && property_exists($reply,'response_code') ) {
$api_rc = $reply->response_code;
} else {
$api_rc = -99;
Expand Down

0 comments on commit 53e947b

Please sign in to comment.