Skip to content

Commit

Permalink
[TIMOB-26455] Sanitize numeric names (#308)
Browse files Browse the repository at this point in the history
  • Loading branch information
garymathews authored and janvennemann committed Oct 17, 2018
1 parent 53b5033 commit 569d809
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions android/hooks/metabase/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ function safeName(name) {
if (name.match(/^(decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|escape|eval|isFinite|isNaN|parseFloat|parseInt|unescape|uneval)$/)) {
return '_' + name;
}
// Replace numeric prefix
if (name.match(/^\d+/)) {
return '_' + name;
}
return name;
}

Expand Down

0 comments on commit 569d809

Please sign in to comment.