Add /uploads to dumbbox whitelist
-
It's annoying whenever I paste an image link to what.thedailywtf.com, and it doesn't dumbbox. Other images dumbbox.
I know we don't want to dumbbox
src='logout.aspx'
.Can we just dumbbox if it's
what.thedailywtf.com/uploads/files/*
?https://what.thedailywtf.com/uploads/files/1472952921478-iceewhatyoudidthere-resized.png
-
@Lorne-Kates said in Add /uploads to dumbbox whitelist:
I know we don't want to dumbbox
src='logout.aspx'
.Actually, the reason we don't allow this domain for iframely is that linking to another post on the same page creates an infinitely recursive page generation process.
-
@Lorne-Kates said in Add /uploads to dumbbox whitelist:
I know we don't want to dumbbox
src='logout.aspx'
.Oh yeah. I remember that one.
Good times, good times.
-
@ben_lubar said in Add /uploads to dumbbox whitelist:
linking to another post on the same page creates an infinitely recursive page generation process.
-
@ben_lubar because iFramely doesn't accept a URL with domain and path, only a domain? It's even more retarded than I thought.
-
@Arantor said in Add /uploads to dumbbox whitelist:
@ben_lubar because iFramely doesn't accept a URL with domain and path, only a domain? It's even more retarded than I thought.
Hmm, actually, the blacklist we've been using was the NodeBB plugin's blacklist.
Fake edit: Ok, here's the current portion of the config that matters:
SKIP_OEMBED_RE_LIST: [ /^https?:\/\/(what|forums)\.thedailywtf\.com\//, ],
Does anyone know how to match anything that's not in the uploads directory? Normally, I'd use lookahead or lookbehind, but this is JavaScript.
-
@ben_lubar said in Add /uploads to dumbbox whitelist:
how to match anything that's not in the uploads directory
This is regex, right?
^https?:\/\/(what|forums)\.thedailywtf\.com(?!\/uploads)/
Unit tests: (click the link, then "switch to unit tests")
-
@Yamikuronue said in Add /uploads to dumbbox whitelist:
^https?://(what|forums).thedailywtf.com(?!/uploads)/
E_PARSE_FAIL
^https?:\/\/(what|forums)\.thedailywtf\.com(?!\/uploads)\/
that's better, and passes tests. :-)
-
@Yamikuronue @accalia oh wow, I thought JavaScript didn't support that.
-
@accalia Sorry, the final delimiter somehow made it into my paste on accident. I updated the saved expression
-
@ben_lubar It doesn't support lookbehind, but it supports lookahead
-
I think I'll go with
^https?:\/\/(what|forums)\.thedailywtf\.com(?!\/uploads\/)\/((?!\/\.\.).)*$