From 965263492aa887ea079624dba361d74c61cb41aa Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Mon, 26 Jun 2017 15:35:00 -0700 Subject: fix JSON request to always send arrays --- views/new-post.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'views/new-post.php') 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"], -- cgit v1.2.3