summaryrefslogtreecommitdiff
path: root/src/couchdb/couch_js_functions.hrl
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@apache.org>2010-11-21 14:09:19 +0000
committerFilipe David Borba Manana <fdmanana@apache.org>2010-11-21 14:09:19 +0000
commitedb080af8286e89c9154a077cda678ba26ab1bc0 (patch)
tree64058bc512c17c9a20939f20afbcccc0f5f44f90 /src/couchdb/couch_js_functions.hrl
parent3112aa0692df79d0d92b92842e5de971bfc90fa9 (diff)
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
Diffstat (limited to 'src/couchdb/couch_js_functions.hrl')
-rw-r--r--src/couchdb/couch_js_functions.hrl3
1 files changed, 1 insertions, 2 deletions
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.');
}