public function listed(string $url, $returnType = false)
    {
        if (empty($this->apiKey)) {
            throw new Exception('A Google Safebrowsing API key has not been specified');
        }

        // Retrieve the result from SafeBrowsing
        $result = $this->getSafebrowsingResult($url);

        // Check for exististance of the supplied URL in any matches
        if (is_object($result) and isset($result->matches)) {
            foreach ($result->matches as $match) {
                if ($match->threat->url == $url) {
                    // Return the Threat Type if requested,
                    // otherwise return true
                    if ($returnType) {
                        return $match->threatType;
                    }
                    
                    return true;
                }
            }
        }

        return false;
    }
public function listed(string $url, $returnType = false)
    {
        if (empty($this->apiKey)) {
            throw new Exception('A Google Safebrowsing API key has not been specified');
        }

        // Retrieve the result from SafeBrowsing
        $result = $this->getSafebrowsingResult($url);

        // Check for exististance of the supplied URL in any matches
        if (is_object($result) and isset($result->matches)) {
            foreach ($result->matches as $match) {
                if ($match->threat->url == $url) {
                    // Return the Threat Type if requested,
                    // otherwise return true
                    if ($returnType) {
                        return $match->threatType;
                    }
                    
                    return true;
                }
            }
        }

        return false;
    }
public function listed ( string $ url , $ returnType = false ) { if ( empty ( $ this -> apiKey ) ) { throw new Exception ( 'A Google Safebrowsing API key has not been specified' ) ; } // Retrieve the result from SafeBrowsing $ result = $ this -> getSafebrowsingResult ( $ url ) ; // Check for exististance of the supplied URL in any matches if ( is_object ( $ result ) and isset ( $ result -> matches ) ) { foreach ( $ result -> matches as $ match ) { if ( $ match -> threat -> url == $ url ) { // Return the Threat Type if requested, // otherwise return true if ( $ returnType ) { return $ match -> threatType ; } return true ; } } } return false ; }
Return listed status from Google Safebrowsing. Returns true on listed status
@param  string $url
@param  bool   $returnType
@return bool|string
Return listed status from Google Safebrowsing . Returns true on listed status