Author: fdmanana Date: Sun Nov 21 14:09:19 2010 New Revision: 1037457 URL: http://svn.apache.org/viewvc?rev=1037457&view=rev Log: Merged revision 1037455 from trunk:
Add proper validation of user_ctx.roles for replication documents. Modified: couchdb/branches/1.1.x/src/couchdb/couch_js_functions.hrl Modified: couchdb/branches/1.1.x/src/couchdb/couch_js_functions.hrl URL: http://svn.apache.org/viewvc/couchdb/branches/1.1.x/src/couchdb/couch_js_functions.hrl?rev=1037457&r1=1037456&r2=1037457&view=diff ============================================================================== --- couchdb/branches/1.1.x/src/couchdb/couch_js_functions.hrl (original) +++ couchdb/branches/1.1.x/src/couchdb/couch_js_functions.hrl Sun Nov 21 14:09:19 2010 @@ -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.'); }