Author: fdmanana
Date: Sun Nov 21 14:08:33 2010
New Revision: 1037455

URL: http://svn.apache.org/viewvc?rev=1037455&view=rev
Log:
Add proper validation of user_ctx.roles for replication documents.

Modified:
    couchdb/trunk/src/couchdb/couch_js_functions.hrl

Modified: couchdb/trunk/src/couchdb/couch_js_functions.hrl
URL: 
http://svn.apache.org/viewvc/couchdb/trunk/src/couchdb/couch_js_functions.hrl?rev=1037455&r1=1037454&r2=1037455&view=diff
==============================================================================
--- couchdb/trunk/src/couchdb/couch_js_functions.hrl (original)
+++ couchdb/trunk/src/couchdb/couch_js_functions.hrl Sun Nov 21 14:08:33 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.');
             }


Reply via email to