ResistanceOfColorado / iitc

IITC Plugins
1 stars 1 forks source link

Name containing zeroes can't be replaced due to name-matching regex #1

Closed ConspicuousCompiler closed 6 years ago

ConspicuousCompiler commented 6 years ago

https://github.com/ResistanceOfColorado/iitc/blob/a2669fd3b100d5f1b1f7053d0445ee9236f8ce43/barcodes.user.js#L51

The username for trulydread (0IIIIIII0) can't be translated by the barcode plugin because the regex:

window.plugin.barcodes.barPatt = new RegExp("^[Il]{15}$");

doesn't match the agent name.

Should be updated to something like:

window.plugin.barcodes.barPatt = new RegExp("^[0OIl]{15}$");

lsulliv commented 6 years ago

Can you provide an example of where this is an issue? Translation is only meant to be used if there isn't a match in nameMap - in this case, your example name is in the map and would be returned. Translation only applies to 15 character "conforming" barcodes and would be triggered if a nickname isn't in the map so it would attempt to decode the 3 char trigraph, such as EMI, VEX, VEM, VEK, ASS, etc, and return that as a means to distinguish multiple barcodes from one another.

Closing this issue, since AFAIK, this is working as intended. Please let me know if you have an example that supports reopening the issue.