git.cweiske.de
/
anoweco.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Simple latest comment list
[anoweco.git]
/
www
/
micropub.php
diff --git
a/www/micropub.php
b/www/micropub.php
index e028782695fa5ea686b464fa2f125763eb620984..eff6ea7f26fde64042859ad3a79d36fa06e486fb 100644
(file)
--- a/
www/micropub.php
+++ b/
www/micropub.php
@@
-165,7
+165,8
@@
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
'Content-Type header missing.'
);
}
'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';
if ($ctype == 'application/x-www-form-urlencoded') {
if (!isset($_POST['action'])) {
$_POST['action'] = 'create';
@@
-211,8
+212,8
@@
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
$json = $base;
$json->properties = (object) $data;
handleCreate($json, $token);
$json = $base;
$json->properties = (object) $data;
handleCreate($json, $token);
- } else if ($ctype == 'application/j
avascript
') {
- $input = file_get_contents('php://
stdin
');
+ } else if ($ctype == 'application/j
son
') {
+ $input = file_get_contents('php://
input
');
$json = json_decode($input);
if ($json === null) {
mpError(
$json = json_decode($input);
if ($json === null) {
mpError(