From e3a4ee8a7b2bce75e22da548eb0c475dd24b3d3c Mon Sep 17 00:00:00 2001 From: Jan Steemann Date: Fri, 20 Feb 2015 15:46:27 +0100 Subject: [PATCH] strip illegal characters from collection names --- js/server/modules/org/arangodb/foxx/arangoApp.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/server/modules/org/arangodb/foxx/arangoApp.js b/js/server/modules/org/arangodb/foxx/arangoApp.js index 423293ff39..cb454d3bd0 100644 --- a/js/server/modules/org/arangodb/foxx/arangoApp.js +++ b/js/server/modules/org/arangodb/foxx/arangoApp.js @@ -98,7 +98,8 @@ }; AppContext.prototype.collectionName = function (name) { - var replaced = this.collectionPrefix + name.replace(/[^a-zA-Z0-9]/g, '_').replace(/(^_+|_+$)/g, '').substr(0, 64); + var replaced = this.collectionPrefix.replace(/[:\.]+/g, '_') + + name.replace(/[^a-zA-Z0-9]/g, '_').replace(/(^_+|_+$)/g, '').substr(0, 64); if (replaced.length === 0) { throw new Error("Cannot derive collection name from '" + name + "'");