From edb080af8286e89c9154a077cda678ba26ab1bc0 Mon Sep 17 00:00:00 2001 From: Filipe David Borba Manana Date: Sun, 21 Nov 2010 14:09:19 +0000 Subject: Merged revision 1037455 from trunk: Add proper validation of user_ctx.roles for replication documents. git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1037457 13f79535-47bb-0310-9956-ffa450edef68 --- src/couchdb/couch_js_functions.hrl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (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 347cc7b0..a2a40b3c 100644 --- a/src/couchdb/couch_js_functions.hrl +++ b/src/couchdb/couch_js_functions.hrl @@ -121,8 +121,7 @@ 'non-empty string.'); } - if ((typeof user_ctx.roles !== 'undefined') && - (typeof user_ctx.roles.length !== 'number')) { + if (user_ctx.roles && !isArray(user_ctx.roles)) { reportError('The roles property of the user_ctx must be ' + 'an array of strings.'); } -- cgit v1.2.3