#dev | Logs for 2020-04-26

« return
[01:23:27] -!- YanetGarcia [YanetGarcia!1b913788@rtiqgsrheawabq-y.clients.kiwiirc.com] has joined #dev
[01:25:55] -!- YanetGarcia has quit [Client Quit]
[02:44:23] -!- AdrianaLima [AdrianaLima!010a852c@rtiqgsrheawabq-y.clients.kiwiirc.com] has joined #dev
[02:46:49] -!- AdrianaLima has quit [Client Quit]
[04:27:45] -!- JojoBabie [JojoBabie!244aa410@rtiqgsrheawabq-y.clients.kiwiirc.com] has joined #dev
[04:30:33] -!- JojoBabie has quit [Client Quit]
[06:30:09] -!- MirandaKerr [MirandaKerr!17edad66@rtiqgsrheawabq-y.clients.kiwiirc.com] has joined #dev
[06:32:33] -!- MirandaKerr has quit [Client Quit]
[08:00:17] -!- JenSelter [JenSelter!2d934c25@rtiqgsrheawabq-y.clients.kiwiirc.com] has joined #dev
[08:02:39] -!- JenSelter has quit [Client Quit]
[09:17:04] -!- SierraSkye [SierraSkye!a747c9e8@rtiqgsrheawabq-y.clients.kiwiirc.com] has joined #dev
[09:19:29] -!- SierraSkye has quit [Client Quit]
[10:41:53] -!- MoniAlvarez [MoniAlvarez!ab606aa4@rtiqgsrheawabq-y.clients.kiwiirc.com] has joined #dev
[10:44:19] -!- MoniAlvarez has quit [Client Quit]
[12:00:13] -!- AliciaAway [AliciaAway!a3acbea0@rtiqgsrheawabq-y.clients.kiwiirc.com] has joined #dev
[12:02:38] -!- AliciaAway has quit [Client Quit]
[13:38:49] <Bytram> TheMightyBuzzard: I *think* there's a site var that can be adjusted to block trailing spaces being accepted when creating a nickname for a new account... Variable Name: nick_regex Value: ^[a-zA-Z_][ a-zA-Z0-9$_.+!*'(),-]{0,34}$ Description: Regex (case-sensitive) allowed for user nicknames
[13:39:54] <Bytram> need to handle not just one trailing space, as well as when an invalid char is removed and then presenting a now-uncovered trailing space.
[13:40:11] <TheMightyBuzzard> there is, gimme a few. need nicotine
[13:40:27] <Bytram> depends on when this comes into play in the template
[13:42:50] <Bytram> ^(([a-zA-Z_])([ a-zA-Z0-9$_.+!*'(),-])*([a-zA-Z0-9$_.+!*'(),-])){1,35}$
[13:44:41] <Bytram> Initial alpha + underscore, any number of intermediate permitted chars, tailing sequence of same set, but without permitting a space. All-together must be from 1-35 chars
[13:45:09] * Bytram *thinks* that is correct. Not tested.
[13:45:59] <Bytram> =)
[13:46:19] <Bytram> break time. biab
[14:04:02] <TheMightyBuzzard> Bytram, nope, it's a code change
[14:08:50] <Bytram> see the template: newUserForm;login;default
[14:11:14] <TheMightyBuzzard> see the function nickFix in Slash/Utility/Data/Data.pm
[14:11:24] <Bytram> looking
[14:12:17] <TheMightyBuzzard> needs a s/\s+$// below the second sedifying
[14:15:20] <Bytram> if nick_regex is defined, and set to the value I presented, it should work. OTOH, if nick_regex is NOT defined, then yeah, need your change.
[14:15:55] <Bytram> cleaner to put the change in Data.pm, especially for the long term.
[14:16:56] <Bytram> But, if the Data.pm change will be a while, I think my regexp *should* work right now.
[14:18:22] <TheMightyBuzzard> nick_regex is not used by newUserForm;login;default
[14:19:41] <Bytram> nick_regex is used in Data.pm
[14:21:24] <TheMightyBuzzard> ugh, stoopid escaping
[14:22:40] <Bytram> see line 172: my $nr = $constants->{nick_regex} || '^[a-z]$';
[14:22:40] <Bytram> and line 177: return '' if $nick !~ $nr;
[14:22:48] <TheMightyBuzzard> doesn't work
[14:23:06] <Bytram> ~blame pre-emptive =)
[14:23:36] <TheMightyBuzzard> your regex i mean
[14:23:59] <Bytram> Oh, could well be.
[14:24:16] * Bytram wonders what is wrong with it
[14:25:08] * TheMightyBuzzard shurgs
[14:25:48] <TheMightyBuzzard> doesn't help that we're negating in the regex as stored in the db and again in the sed
[14:26:30] <Bytram> huh? Isn't this code active before the nick ever gets to the DB?
[14:26:44] <TheMightyBuzzard> the regex is stored in the db
[14:26:48] <TheMightyBuzzard> all VARS are
[14:27:31] <Bytram> oh, that. sure. oh, you mean we need to update the code so that the updated regexp persists after a rebuild?
[14:27:42] <TheMightyBuzzard> ... wut?
[14:28:11] <Bytram> vars, IIRC, take effect immediately (or at least after a bounce of the front ends)
[14:28:14] <TheMightyBuzzard> i mean i don't have any clue how to get a regex working without changing the code we have
[14:29:01] <TheMightyBuzzard> the stored regex starts with ^, which means negate. so does the place that it's used, so double negation.
[14:29:44] <Bytram> nope. ^ at the start means that the pattern is anchored so that it *must* match the first char. same as how $ means an anchor on the end.
[14:30:20] <TheMightyBuzzard> yes, if it's outside []s. if it's the first character inside it means negate this pattern.
[14:30:45] <Bytram> yes, agreed on inside []s
[14:31:00] <TheMightyBuzzard> and $nick =~ s/[^$nc]+//g;
[14:31:28] <TheMightyBuzzard> oh that's nick_chars not nick_regex
[14:31:36] <Bytram> ding ding ding
[14:33:17] <TheMightyBuzzard> unfortunately nick_regex will not sed out the trailing spaces, only disallow that nick entirely
[14:33:22] <Bytram> that said, I'm sense some possible bypass when one gets near nick_maxlen after the substr
[14:33:47] <Bytram> well, that would help cut down on spammer accounts. =)
[14:34:13] <TheMightyBuzzard> rather go with the path of least annoyance to users
[14:34:20] * Bytram notes that is where it became most apparent to him, although other non-spam accounts have run afoul of that, too.
[14:34:24] <Bytram> while we're at it?
[14:34:24] <TheMightyBuzzard> and they never see spammers at the moment
[14:34:33] <Bytram> nod nod
[14:34:55] <Bytram> unless I am mistaken, we would allow the creation of this account: "Anonymous User"
[14:35:16] <TheMightyBuzzard> nope
[14:35:30] <TheMightyBuzzard> $nick =~ s/\s+/ /g;
[14:35:31] <Bytram> ahhhh
[14:35:33] <Bytram> yep
[14:35:44] <Bytram> Like I said, unless I'm mistaken (whew!)
[14:35:56] <Bytram> thanks for the correction!
[14:36:05] * TheMightyBuzzard tips his hat to miss taken
[14:36:21] <Bytram> :: laughter ::
[14:36:26] <Bytram> thanks for that one!!!!!!!!!!
[14:37:45] <Bytram> so, looks like we need something after: $nick =~ s/[^$nc]+//g;
[14:38:38] <TheMightyBuzzard> yup. $nick =~ s/\s+$//;
[14:39:18] <Bytram> wouldn't that strip all spaces?
[14:39:39] <Bytram> oh, nvm
[14:39:49] <Bytram> that gets the trailing spaces
[14:39:54] <TheMightyBuzzard> rust has some kinda nice fuckOffLeadingWhitespace and fuckOffTrailingWhitespace functions. no need for a regex.
[14:40:05] <Bytram> noice
[14:40:29] <Bytram> likely implemented as some kind of regexp =)
[14:40:40] <Bytram> syntacticsugar++
[14:40:41] <Bender> karma - syntacticsugar: 1
[14:41:22] <Bytram> actually, your regexp should come *after* the substr.
[14:41:26] <TheMightyBuzzard> more likely a hardcoded set of if thens for the fasterness
[14:41:55] <Bytram> does rust trim *all* unicode spaces?
[14:41:59] <TheMightyBuzzard> nah. it should really come at the beginning.
[14:42:01] <TheMightyBuzzard> yup
[14:42:19] <TheMightyBuzzard> they keep up with that garbage so i don't gotta
[14:42:55] <Bytram> anyway, after the substr, a 36-char nick that ends in "abcde f" and the "f" gets lobbed off, it reveals a trailing space. right?
[14:46:08] <Bytram> what do think about this code sequence?
[14:46:12] <Bytram> PASTE_BEGIN
[14:46:13] <Bytram> $nick =~ s/\s+/ /g;
[14:46:13] <Bytram> $nick =~ s/[^$nc]+//g;
[14:46:13] <Bytram> $nick =~ s/^\s+//g;
[14:46:13] <Bytram> $nick = substr($nick, 0, $constants->{nick_maxlen});
[14:46:13] <Bytram> $nick =~ s/\s+$//g;
[14:46:17] <Bytram> PASTE_END
[14:47:00] <Bytram> Collapses sequences of spaces to a single space.
[14:47:13] <Bytram> Removes all not-permitted chars
[14:47:20] <Bytram> strips leading spaces
[14:47:37] <Bytram> truncates to 35 chars (currently: see site var)
[14:47:46] <Bytram> trims trailing spaces
[14:48:01] <Bytram> I'm pretty sure that's got it covered.
[14:48:57] <Bytram> teamwork++
[14:48:57] <Bender> karma - teamwork: 18
[14:51:00] <TheMightyBuzzard> $nick =~ s/^\s+//g; is all kinds of wrong
[14:51:20] <Bytram> note: no {}s
[14:51:22] <Bytram> ugh
[14:51:24] <Bytram> no []s
[14:51:31] <TheMightyBuzzard> for starters, checking for a space at the beginning is unnecessary as it's already covered.
[14:51:49] <TheMightyBuzzard> also, the g means search the whole string, which makes no sense in this context
[14:52:01] * TheMightyBuzzard chuckles
[14:52:06] <Bytram> oh, copy pasta error on the g
[14:52:12] <TheMightyBuzzard> more coffee for you!
[14:52:32] <Bytram> and gotta drain the last one, too. and other stuff. biab =)
[14:52:41] <TheMightyBuzzard> i gotta run anyway
[14:52:47] <Bytram> nod nod
[14:53:04] <Bytram> really enjoyed working with ya this morning!
[14:53:16] <TheMightyBuzzard> yar
[14:53:16] * Bytram misses collaborative code development
[14:53:49] * Bytram is still trying to see how leading spaces are already suppressed.
[14:54:00] <Bytram> its gotta wait. afk, biab
[15:12:29] <Bytram> Oh, nick gets kicked out (unceremoniously) by nick_regex