MrOtherGuy/fx-autoconfig

Bug in the script file regex

aminomancer opened this issue · 1 comments

I noticed some files I marked script.uc.js.disabled were still showing up in fx-autoconfig, so did some testing. You can take a .exe file and change its name to program.uc.js.exe and it'll confuse fx-autoconfig. It's because of this expression:

/(.+\.uc\.js)|(.+\.sys\.mjs)$/i

The first capturing group doesn't have an end anchor, so although it'll exclude module.sys.mjs.exe it will still match script.uc.js.exe. Here are 2 possibilities, I probably screwed them up somehow but they seem to work correctly:

/(.+\.uc\.js|.+\.sys\.mjs)$/i
/(.+\.uc\.js)$|(.+\.sys\.mjs)$/i

Ugh, nice catch - friggin regexp, you always mess something up.

I went with /(.+\.uc\.js|.+\.sys\.mjs)$/i and then created bunch of bogus test scripts in 93a10c0 with names that are supposed to be invalid. It does indeed look like the manager correctly ignores them now.