Browse Source

compatible Content-Type

compatible with Content-Type:application/x-www-form-urlencoded; charset=UTF-8
walkor 8 years ago
parent
commit
aed29ddf08
1 changed files with 5 additions and 1 deletions
  1. 5 1
      Protocols/Http.php

+ 5 - 1
Protocols/Http.php

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