wiremod / wire

Garry's Mod add-on that allows users to wire up components in order to make more elaborate automatic and user-controlled contraptions.
http://www.wiremod.com
Apache License 2.0
551 stars 331 forks source link

Missing pattern checks #2992

Closed Vurv78 closed 5 months ago

Vurv78 commented 6 months ago

Pattern complexity checks are missing in certain parts of code

  1. Gates
  2. E2 find library

Haven't looked much into it

Denneisk commented 6 months ago

Could simply run WireLib.CheckRegex against every occurance, only I ran into a problem with E2 find library: the pattern is stored before it's used, and it's expected to be used against every entity's classname. Pausing the find operation in the middle would be bad UX, but you can't expect the longest entity's classname. Maybe just test it on definition against a dummy 32 character string? Could open up a branch to show you what I mean.

thegrb93 commented 5 months ago

Yeah, running the check against a 32 length sounds fine for e2 find lib.