You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 6, 2021. It is now read-only.
Currently, if an op sets a ban duration in a format eir doesn't recognize (e.g. ~1y thinking it will be a year-long ban), this will silently assume the ban to expire in just 1 (which is assumed to be minutes by default). It'd probably be more desirable to complain to the commenting op.
Allowing 'y' to indicate years would only be a partial solution as eir would still accept other invalid inputs. While it could be argued that those are the commenting op's problem, I feel it'd be nicer to tell them what they're doing wrong in that case.
Side note: The regex used uses a \d character class. This probably ought to be [0-9] to avoid matching Unicode digits that aren't handled as numbers by Perl, such as ٧ (U+0667, ARABIC-INDIC DIGIT SEVEN). Alternatively, the /a modifier introduced in Perl 5.14 could be used.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Currently, if an op sets a ban duration in a format eir doesn't recognize (e.g.
~1y
thinking it will be a year-long ban), this will silently assume the ban to expire in just1
(which is assumed to be minutes by default). It'd probably be more desirable to complain to the commenting op.The relevant code is in
sub calc_time
:eir/scripts/bantracker.pl
Lines 718 to 740 in 6a267fb
Allowing 'y' to indicate years would only be a partial solution as eir would still accept other invalid inputs. While it could be argued that those are the commenting op's problem, I feel it'd be nicer to tell them what they're doing wrong in that case.
Side note: The regex used uses a
\d
character class. This probably ought to be[0-9]
to avoid matching Unicode digits that aren't handled as numbers by Perl, such as ٧ (U+0667, ARABIC-INDIC DIGIT SEVEN). Alternatively, the/a
modifier introduced in Perl 5.14 could be used.The text was updated successfully, but these errors were encountered: