1

我在 Centos 5.9、PHP 5.4 和较旧的 PHP 程序扩展(typo3 CMS)中收到此错误消息。

PHP 致命错误:在第 279 行的 class.tx_spscoutnetcalendar_pi1.php 中删除了调用时传递引用

这是模拟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.1\r\nHost: " . $url['host'] . "\r\n\r\n");
                    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;
    }

而具体这一行 279

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

请在这里提供任何帮助,我不是php专家。

4

1 回答 1

5

只需像这样删除前导&

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

变量仍然是通过引用传递的,但是从 PHP 5.4 开始,您不需要&指明这一点。

于 2013-10-29T11:36:47.263 回答