summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorAaron Parecki <aaron@parecki.com>2017-06-26 15:35:00 -0700
committerAaron Parecki <aaron@parecki.com>2017-06-26 15:35:00 -0700
commit965263492aa887ea079624dba361d74c61cb41aa (patch)
tree1a8eecefd51059bd52a60958f6d2a2f046e2454a /views
parentcbde68bafe96479358416021a93a311d3dc8f5cc (diff)
fix JSON request to always send arrays
Diffstat (limited to 'views')
-rw-r--r--views/new-post.php6
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"],