diff options
author | Fbenas <philbeansburton@gmail.com> | 2015-12-05 19:32:39 +0000 |
---|---|---|
committer | Fbenas <philbeansburton@gmail.com> | 2015-12-05 19:32:39 +0000 |
commit | 56380864115d6df864edf80e43492bf890a75521 (patch) | |
tree | 912eea56df8e4b1232171c109054a8fc6fa8d407 /search.php | |
parent | 01494a7fb63fd99544ca39158dd1b48c7c6cd9b7 (diff) |
Allow use on other urls making password optional
Diffstat (limited to 'search.php')
-rw-r--r-- | search.php | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -10,9 +10,13 @@ try { } // hash the password - $hash = hash("sha256", $config['password']); + if (isset($config['password'])) { + $hash = hash("sha256", $config['password']); + } $curl = curl_init($config["url"]. "?format=json"); - curl_setopt($curl, CURLOPT_HTTPHEADER, array("Cookie: password=$hash")); + if (isset($hash)) { + curl_setopt($curl, CURLOPT_HTTPHEADER, array("Cookie: password=$hash")); + } curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $output = json_decode(curl_exec($curl)); curl_close($curl); |