|
@@ -254,6 +254,12 @@ class request_helper
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ static function start_with ($string, $startString)
|
|
|
|
+ {
|
|
|
|
+ $len = strlen($startString);
|
|
|
|
+ return (substr($string, 0, $len) === $startString);
|
|
|
|
+ }
|
|
|
|
+
|
|
static public function fill_param()
|
|
static public function fill_param()
|
|
{
|
|
{
|
|
$method = strtolower(request_helper::method());
|
|
$method = strtolower(request_helper::method());
|
|
@@ -265,14 +271,26 @@ class request_helper
|
|
$_SERVER['post_content'] = $content;
|
|
$_SERVER['post_content'] = $content;
|
|
}
|
|
}
|
|
|
|
|
|
- $content_type = strtolower(self::content_type());
|
|
|
|
- Log::record("type = {$content_type}, content={$content}",Log::DEBUG);
|
|
|
|
|
|
+ if(!empty($content))
|
|
|
|
+ {
|
|
|
|
+ $content_type = strtolower(self::content_type());
|
|
|
|
+ Log::record("type = {$content_type}, content={$content}",Log::DEBUG);
|
|
|
|
|
|
-// $formtypes = ['application/x-www-form-urlencoded','text/xml','text/html'];
|
|
|
|
|
|
+ $checker = function ($stype)
|
|
|
|
+ {
|
|
|
|
+ $formtypes = ['application/x-www-form-urlencoded','text/xml','text/html','multipart/form-data'];
|
|
|
|
+ foreach ($formtypes as $type) {
|
|
|
|
+ if(self::start_with($stype,$type)) {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return false;
|
|
|
|
+ };
|
|
|
|
|
|
-// if(empty($content_type) || in_array($content_type,$formtypes)) {
|
|
|
|
- self::parse_formurl($content,$method);
|
|
|
|
-// }
|
|
|
|
|
|
+ if(empty($content_type) || $checker($content_type)) {
|
|
|
|
+ self::parse_formurl($content,$method);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
static private function parse_formurl($squery,$method)
|
|
static private function parse_formurl($squery,$method)
|