Permalink
Browse files

Slightly more obessive RegExp escaping.

  • Loading branch information...
borgar committed Oct 16, 2012
1 parent 71cf8fa commit 29b1d88fb9a0cddb9c9e1e2ea8ee387e6b62f632
Showing with 1 addition and 1 deletion.
  1. +1 −1 router.js
View
@@ -31,7 +31,7 @@ Router.prototype = {
opts = null;
}
if ( typeof path === 'string' ) { // escape regexp control chars & compile expression
- path = new RegExp( '^(' + path.replace( /[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&" ) + ')' );
+ path = new RegExp( '^(' + path.replace( /[-\[\]{}()*+?.,\\^$|#\s]/g, "\\$&" ) + ')' );
}
if ( typeof path !== 'function' || !('exec' in path) ) {
throw new TypeError( 'Invalid expression passed to handler' );

0 comments on commit 29b1d88

Please sign in to comment.