Jelajahi Sumber

compatible Content-Type

compatible with Content-Type:application/x-www-form-urlencoded; charset=UTF-8
walkor 8 tahun lalu
induk
melakukan
aed29ddf08
1 mengubah file dengan 5 tambahan dan 1 penghapusan
  1. 5 1
      Protocols/Http.php

+ 5 - 1
Protocols/Http.php

@@ -145,7 +145,11 @@ class Http
                 // content-type
                 case 'CONTENT_TYPE':
                     if (!preg_match('/boundary="?(\S+)"?/', $value, $match)) {
-                        $_SERVER['CONTENT_TYPE'] = $value;
+                        if ($pos = strpos($value, ';')) {
+                            $_SERVER['CONTENT_TYPE'] = substr($value, 0, $pos);
+                        } else {
+                            $_SERVER['CONTENT_TYPE'] = $value;
+                        }
                     } else {
                         $_SERVER['CONTENT_TYPE'] = 'multipart/form-data';
                         $http_post_boundary      = '--' . $match[1];