Skip to content

Commit

Permalink
fix unneeded regex escape
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentfretin committed Oct 6, 2022
1 parent 0a6eb68 commit e4f3a1b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/modals/ModalTextures.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function getFilename(url, converted = false) {

function isValidId(id) {
// The correct re should include : and . but A-frame seems to fail while accessing them
var re = /^[A-Za-z]+[\w\-]*$/;
var re = /^[A-Za-z]+[\w-]*$/;
return re.test(id);
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/widgets/TextureWidget.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export default class TextureWidget extends React.Component {
var context = canvas.getContext('2d');

function paintPreviewWithImage(image) {
var filename = image.src.replace(/^.*[\\\/]/, '');
var filename = image.src.replace(/^.*[\\/]/, '');
if (image !== undefined && image.width > 0) {
canvas.title = filename;
var scale = canvas.width / image.width;
Expand Down

0 comments on commit e4f3a1b

Please sign in to comment.