]> git.mxchange.org Git - friendica.git/commitdiff
alter test for http continuation header. Use regex, ignore length.
authorFriendika <info@friendika.com>
Sun, 3 Jul 2011 07:34:56 +0000 (00:34 -0700)
committerFriendika <info@friendika.com>
Sun, 3 Jul 2011 07:34:56 +0000 (00:34 -0700)
boot.php

index 5ff8b50af4440003910b721b3824b7aa1f64e51f..35adae3308de5fa629b4a81290c54f48fe81878d 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -704,7 +704,7 @@ function fetch_url($url,$binary = false, &$redirects = 0) {
 
        $http_code = intval(curl_getinfo($ch, CURLINFO_HTTP_CODE));
        $header = substr($s,0,strpos($s,"\r\n\r\n"));
-       if(stristr($header,'100') && (strlen($header) < 30)) {
+       if(preg_match('/HTTP\/.+? 100/',$header)) {
                // 100 Continue has two headers, get the real one
                $s = substr($s,strlen($header)+4);
                $header = substr($s,0,strpos($s,"\r\n\r\n"));
@@ -777,7 +777,7 @@ function post_url($url,$params, $headers = null, &$redirects = 0) {
 
        $http_code = intval(curl_getinfo($ch, CURLINFO_HTTP_CODE));
        $header = substr($s,0,strpos($s,"\r\n\r\n"));
-       if(stristr($header,'100') && (strlen($header) < 30)) {
+       if(preg_match('/HTTP\/.+? 100/',$header)) {
                // 100 Continue has two headers, get the real one
                $s = substr($s,strlen($header)+4);
                $header = substr($s,0,strpos($s,"\r\n\r\n"));