$newurl = $curl_info['redirect_url'];
- if (($new_location_info['path'] == '') AND ( $new_location_info['host'] != '')) {
+ if (($new_location_info['path'] == '') && ( $new_location_info['host'] != '')) {
$newurl = $new_location_info['scheme'] . '://' . $new_location_info['host'] . $old_location_info['path'];
}
if (!$ret['success']) {
$ret['error'] = curl_error($ch);
$ret['debug'] = $curl_info;
- logger('z_fetch_url: error: ' . $url . ': ' . $ret['error'], LOGGER_DEBUG);
- logger('z_fetch_url: debug: ' . print_r($curl_info, true), LOGGER_DATA);
+ logger('z_fetch_url: error: '.$url.': '.$ret['return_code'].' - '.$ret['error'], LOGGER_DEBUG);
+ logger('z_fetch_url: debug: '.print_r($curl_info, true), LOGGER_DATA);
}
$ret['body'] = substr($s, strlen($header));
if ($http_code == 0)
return($url);
- if ((($curl_info['http_code'] == "301") OR ($curl_info['http_code'] == "302"))
- AND (($curl_info['redirect_url'] != "") OR ($curl_info['location'] != ""))) {
+ if ((($curl_info['http_code'] == "301") || ($curl_info['http_code'] == "302"))
+ && (($curl_info['redirect_url'] != "") || ($curl_info['location'] != ""))) {
if ($curl_info['redirect_url'] != "")
return(original_url($curl_info['redirect_url'], ++$depth, $fetchbody));
else
return($url);
// if it isn't a HTML file then exit
- if (($curl_info["content_type"] != "") AND !strstr(strtolower($curl_info["content_type"]),"html"))
+ if (($curl_info["content_type"] != "") && !strstr(strtolower($curl_info["content_type"]),"html"))
return($url);
$stamp1 = microtime(true);
*/
function matching_url($url1, $url2) {
- if (($url1 == "") OR ($url2 == ""))
+ if (($url1 == "") || ($url2 == ""))
return "";
$url1 = normalise_link($url1);
$parts1 = parse_url($url1);
$parts2 = parse_url($url2);
- if (!isset($parts1["host"]) OR !isset($parts2["host"]))
+ if (!isset($parts1["host"]) || !isset($parts2["host"]))
return "";
if ($parts1["scheme"] != $parts2["scheme"])
if ($path1 == $path2)
$path .= $path1."/";
- } while (($path1 == $path2) AND ($i++ <= count($pathparts1)));
+ } while (($path1 == $path2) && ($i++ <= count($pathparts1)));
$match .= $path;