-
Bug
-
Resolution: Fixed
-
Minor
-
3.10.5, 4.0.2
-
MOODLE_310_STABLE, MOODLE_400_STABLE
-
MOODLE_311_STABLE, MOODLE_400_STABLE
-
MDL-72349_update_strip_double_headers_function -
Replication steps
Run the following code:
<?php
|
|
require_once('config.php'); |
require_once($CFG->libdir.'/filelib.php'); |
|
$headers = <<<EOF |
HTTP/1.0 200 Connection established
|
|
HTTP/2 200 OK
|
Date: Fri, 22 Feb 2013 17:14:23 GMT |
EOF;
|
|
$rfc822lineendings = preg_replace("~(?!<\r)\n~", "\r\n", $headers); |
$stripped = curl::strip_double_headers($rfc822lineendings); |
|
echo "<pre>"; |
echo $stripped; |
echo "</pre>"; |
Expected result:
HTTP/2 200 OK
|
Date: Fri, 22 Feb 2013 17:14:23 GMT
|
Actual result
HTTP/1.0 200 Connection established
|
|
HTTP/2 200 OK
|
Date: Fri, 22 Feb 2013 17:14:23 GMT
|
This causes problems with simplepie parsing headers when adding RSS feeds when Moodle is behind a proxy. For example; https://www.nasa.gov/rss/dyn/earth.rss (which responds with HTTP/2 200). Effectively hitting what was reported in MDL-38170
Original report below:
Hello,
Since i have upgrade my Moodle to 3.10.5+, from time to time, i've got this message from my Moodle Cron :
PHP Notice: Undefined index: content-type in /var/www/lib/simplepie/library/SimplePie.php on line 1648
No errors detected from scheduled tasks. No interesting logs from the Moodle interface or from the server.
Has anyone seen this problem before ?
PS : my server is behind a web proxy