@@ -79,7 +79,7 @@ router.post('/api/:ref', (req, res, next) => {
7979 } else {
8080 let name = req . body . rename ;
8181 if ( name === undefined || name === "" ) name = doc . name ;
82- if ( name . match ( / ^ [ a - z A - Z 0 - 9 _ \- \. + \[ \] \{ \} \( \) ] { 1 , 32 } $ / ) === null ) {
82+ if ( name . match ( / ^ [ A - z 0 - 9 _ \- \. + \[ \] \{ \} \( \) ] { 1 , 32 } $ / ) === null ) {
8383 req . flash ( 'warning' , 'Only 32 chars max please! Accepted chars: a-Z0-9 _-.+[]{}()' ) ;
8484 res . redirect ( baseURL + '/edit/api/' + req . params . ref ) ;
8585 } else {
@@ -132,7 +132,7 @@ router.post('/list/:ref', (req, res, next) => {
132132 } else {
133133 let name = req . body . rename ;
134134 if ( name === undefined || name === "" ) name = doc . name ;
135- if ( name . match ( / ^ [ a - z A - Z 0 - 9 _ \- \. + \[ \] \{ \} \( \) ] { 1 , 32 } $ / ) === null ) {
135+ if ( name . match ( / ^ [ A - z 0 - 9 _ \- \. + \[ \] \{ \} \( \) ] { 1 , 32 } $ / ) === null ) {
136136 req . flash ( 'warning' , 'Only 32 chars max please! Accepted chars: a-Z0-9 _-.+[]{}()' ) ;
137137 res . redirect ( baseURL + '/view/api/' + req . params . ref ) ;
138138 } else if ( req . file === undefined ) {
@@ -222,7 +222,7 @@ router.post('/snippet/:ref?/:version?', (req, res, next) => {
222222 }
223223
224224 let tags = _ . uniq ( req . body . tags . split ( ',' ) . map ( tag => tag . trim ( ) ) . filter ( tag => tag !== "" ) ) ;
225- let rejects = tags . filter ( tag => tag . match ( / ^ ( [ a - z A - Z 0 - 9 _ \- \. + \[ \] \{ \} \( \) ] { 1 , 32 } ) $ / g) === null ) ;
225+ let rejects = tags . filter ( tag => tag . match ( / ^ ( [ A - z 0 - 9 _ \- \. + \[ \] \{ \} \( \) ] { 1 , 32 } ) $ / g) === null ) ;
226226
227227 Snippet . getCond ( { ref} ) . then ( doc => {
228228 if ( doc . owner !== req . session . user . id ) {
@@ -238,7 +238,7 @@ router.post('/snippet/:ref?/:version?', (req, res, next) => {
238238 req . flash ( 'warning' , 'Names can\'t be changed for Published Snippets' ) ;
239239 res . redirect ( `${ baseURL } /edit/snippet/${ ref } ${ versionFmt } ` ) ;
240240
241- } else if ( name . match ( / ^ [ a - z A - Z 0 - 9 _ \- \. + \[ \] \{ \} \( \) ] { 1 , 32 } $ / ) === null ) {
241+ } else if ( name . match ( / ^ [ A - z 0 - 9 _ \- \. + \[ \] \{ \} \( \) ] { 1 , 32 } $ / ) === null ) {
242242 req . flash ( 'warning' , 'Only 32 chars max please! Accepted chars: a-Z0-9 _-.+[]{}()' ) ;
243243 res . redirect ( `${ baseURL } /edit/snippet/${ ref } ${ versionFmt } ` ) ;
244244
0 commit comments