File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -78,6 +78,14 @@ var Controller = Class.extend(
7878 */
7979 restfulRouting : true ,
8080
81+ /**
82+ * Regex used to determine what constitutes a valid
83+ *
84+ * @default true
85+ * @type {Boolean }
86+ */
87+ idRegex : / ( ^ [ 0 - 9 ] + $ | ^ [ 0 - 9 a - f A - F ] { 24 } $ ) / ,
88+
8189 /**
8290 * Use this function to attach your controller's to routes (either express or restify are supported)
8391 * @return {Function } returns constructor function
@@ -284,7 +292,7 @@ var Controller = Class.extend(
284292 , actionRouting = this . Class . actionRouting
285293 , actionMethod = / \/ ( [ a - z A - z \. ] + ) ( \/ ? | \? .* | \# .* ) ? $ / ig. test ( req . url ) ? RegExp . $1 + 'Action' : ( req . params . action !== undefined ? req . params . action : false )
286294 , restfulRouting = this . Class . restfulRouting
287- , idRegex = / ( ^ [ 0 - 9 ] + $ | ^ [ 0 - 9 a - f A - F ] { 24 } $ ) /
295+ , idRegex = this . Class . idRegex
288296 , hasIdParam = req . params && req . params . id !== undefined ? true : false
289297 , id = ! ! hasIdParam && idRegex . test ( req . params . id ) ? req . params . id : false
290298 , hasActionParam = req . params && req . params . action !== undefined ? true : false
Original file line number Diff line number Diff line change 11{
22 "name" : " clever-controller" ,
33 "description" : " Lightning-fast flexible controller prototype" ,
4- "version" : " 1.2.1 " ,
4+ "version" : " 1.2.2 " ,
55 "main" : " controller.js" ,
66 "repository" : {
77 "type" : " git" ,
You can’t perform that action at this time.
0 commit comments