/ / PHP 5.4 Przekazywanie informacji o czasie połączenia - Czy można to łatwo naprawić? - php

PHP 5.4 Przekazywanie czasu połączenia - Łatwe rozwiązanie tutaj? - php

Mam ten komunikat o błędzie z Centos 5.9, PHP 5.4 i starszym rozszerzeniem programu PHP (typo3 CMS).

Błąd krytyczny PHP: przekazanie informacji o czasie połączenia zostało usunięte w class.tx_spscoutnetcalendar_pi1.php w linii 279

Jest to analogiczne do funkcji kodu php:

    // ********* Start XML code *********
// get XML data from an URL and return it
function fetchCalendarData($xmlUrl,$timeout) {

$xmlSource="";
$url = parse_url($xmlUrl);

$fp = fsockopen($url["host"], "80", &$errno, &$errstr, $timeout);
if ($fp) {
fputs($fp, "GET ".$url["path"]."?".$url["query"]." HTTP/1.1rnHost: " . $url["host"] . "rnrn");
while(!feof($fp))
$xmlSource .= fgets($fp, 128);
}
// strip HTTP header
if ($pos = strpos($xmlSource,"<?xml")) { // this has to be the first line
$xmlSource = substr($xmlSource, $pos);
} else {
$xmlSource="";
}
// I have no idea why, but at the end of the fetched data a "0" breaks the XML syntax and provides an
// error message in the parser. So I just cut the last 5 characters of the fetched data
$xmlSource = substr($xmlSource,0,strlen($xmlSource)-5);
return $xmlSource;
}

I konkretnie ten wiersz 279

$fp = fsockopen($url["host"], "80", &$errno, &$errstr, $timeout);

Proszę o pomoc, nie jestem ekspertem od PHP.

Odpowiedzi:

5 dla odpowiedzi № 1

Po prostu usuń wiodący & lubię to:

$fp = fsockopen($url["host"], "80", $errno, $errstr, $timeout);

zmienne są nadal przekazywane przez referencje, ale nie potrzebujesz & aby wskazać, że począwszy od PHP 5.4.