diff options
author | Aaron Parecki <aaron@parecki.com> | 2017-06-26 15:35:00 -0700 |
---|---|---|
committer | Aaron Parecki <aaron@parecki.com> | 2017-06-26 15:35:00 -0700 |
commit | 965263492aa887ea079624dba361d74c61cb41aa (patch) | |
tree | 1a8eecefd51059bd52a60958f6d2a2f046e2454a /views/new-post.php | |
parent | cbde68bafe96479358416021a93a311d3dc8f5cc (diff) |
fix JSON request to always send arrays
Diffstat (limited to 'views/new-post.php')
-rw-r--r-- | views/new-post.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/views/new-post.php b/views/new-post.php index fb0b3fc..f84f231 100644 --- a/views/new-post.php +++ b/views/new-post.php @@ -700,6 +700,12 @@ $(function(){ } request.send(formData); } else { + // Convert all single-value properties to arrays + for(var k in entry) { + if(typeof entry[k] == "string") { + entry[k] = [entry[k]]; + } + } $.post("/micropub/postjson", { data: JSON.stringify({ "type": ["h-entry"], |