Check for API access and /wp-json/'s users output

This commit is contained in:
g0tmi1k
2018-05-11 17:01:06 +01:00
parent fea6665876
commit ab67816dd9
4 changed files with 99 additions and 8 deletions

View File

@@ -304,3 +304,11 @@ end
def url_encode(str)
CGI.escape(str).gsub("+", "%20")
end
# Check valid JSON?
def valid_json?(json)
JSON.parse(json)
return true
rescue JSON::ParserError => e
return false
end