From 3112aa0692df79d0d92b92842e5de971bfc90fa9 Mon Sep 17 00:00:00 2001 From: Filipe David Borba Manana Date: Sun, 21 Nov 2010 14:05:27 +0000 Subject: Merged revision 1037448 from trunk: Proper verification of the roles property of a user document. Closes COUCHDB-790. Thanks Gabriel Farrell. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1037450 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_js_functions.hrl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/couchdb/couch_js_functions.hrl') diff --git a/src/couchdb/couch_js_functions.hrl b/src/couchdb/couch_js_functions.hrl index e2121aa9..347cc7b0 100644 --- a/src/couchdb/couch_js_functions.hrl +++ b/src/couchdb/couch_js_functions.hrl @@ -31,7 +31,7 @@ throw({forbidden: 'doc.name is required'}); } - if (!(newDoc.roles && (typeof newDoc.roles.length !== 'undefined'))) { + if (newDoc.roles && !isArray(newDoc.roles)) { throw({forbidden: 'doc.roles must be an array'}); } -- cgit v1.2.3