// allow for HTTP/2.x without fixing code
while (preg_match('/^HTTP\/[1-2].+? [1-5][0-9][0-9]/', $base)) {
// allow for HTTP/2.x without fixing code
while (preg_match('/^HTTP\/[1-2].+? [1-5][0-9][0-9]/', $base)) {
- $chunk = substr($base, 0, strpos($base, "\r\n\r\n") + 4);
+ $chunk = substr($base, 0, strpos($base,"\r\n\r\n") + 4);
if (preg_match('/(Location:|URI:)(.*?)\n/i', $header, $matches)) {
$newurl = trim(array_pop($matches));
}
if (preg_match('/(Location:|URI:)(.*?)\n/i', $header, $matches)) {
$newurl = trim(array_pop($matches));
}
-
- if (strpos($newurl, '/') === 0) {
- $newurl = $old_location_info['scheme'] . '://' . $old_location_info['host'] . $newurl;
+ if (strpos($newurl,'/') === 0) {
+ $newurl = $old_location_info["scheme"]."://".$old_location_info["host"].$newurl;
$newurl = trim(array_pop($matches));
if (strpos($newurl, '/') === 0) {
$newurl = trim(array_pop($matches));
if (strpos($newurl, '/') === 0) {
logger('xml_status returning non_zero: ' . $st . " message=" . $message);
header( "Content-type: text/xml" );
logger('xml_status returning non_zero: ' . $st . " message=" . $message);
header( "Content-type: text/xml" );
* @return boolean True if it's a valid URL, fals if something wrong with it
*/
function validate_url(&$url) {
* @return boolean True if it's a valid URL, fals if something wrong with it
*/
function validate_url(&$url) {
- if((is_array($h)) && (dns_get_record($h['host'], DNS_A + DNS_CNAME + DNS_PTR) || filter_var($h['host'], FILTER_VALIDATE_IP) )) {
+ if ((is_array($h)) && (dns_get_record($h['host'], DNS_A + DNS_CNAME + DNS_PTR) || filter_var($h['host'], FILTER_VALIDATE_IP) )) {
- if(($h) && (dns_get_record($h, DNS_A + DNS_CNAME + DNS_PTR + DNS_MX) || filter_var($h, FILTER_VALIDATE_IP) )) {
+ if (($h) && (dns_get_record($h, DNS_A + DNS_CNAME + DNS_PTR + DNS_MX) || filter_var($h, FILTER_VALIDATE_IP) )) {
$found = false;
$fnmatch = function_exists('fnmatch');
$allowed = explode(',',$str_allowed);
$found = false;
$fnmatch = function_exists('fnmatch');
$allowed = explode(',',$str_allowed);
function parse_xml_string($s,$strict = true) {
/// @todo Move this function to the xml class
function parse_xml_string($s,$strict = true) {
/// @todo Move this function to the xml class
- 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
if ($curl_info['redirect_url'] != "")
return(original_url($curl_info['redirect_url'], ++$depth, $fetchbody));
else