Correctly inspect POST content type
authorChristian Weiske <cweiske@cweiske.de>
Fri, 29 Sep 2017 20:41:29 +0000 (22:41 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Fri, 29 Sep 2017 20:41:29 +0000 (22:41 +0200)
www/micropub.php

index b76d997..eff6ea7 100644 (file)
@@ -165,7 +165,8 @@ if ($_SERVER['REQUEST_METHOD'] == 'GET') {
             'Content-Type header missing.'
         );
     }
-    $ctype = $_SERVER['CONTENT_TYPE'];
+    list($ctype) = explode(';', $_SERVER['CONTENT_TYPE'], 2);
+    $ctype = trim($ctype);
     if ($ctype == 'application/x-www-form-urlencoded') {
         if (!isset($_POST['action'])) {
             $_POST['action'] = 'create';