Page 1 of 1

Spoilers and E-mail

PostPosted: Sat Nov 08, 2003 11:44 pm
by shooraijin
I'm not sure if it always had this problem, but spoilers sneak into the messages I get when new replies are added to threads (got a fairly significant one off the Matrix Revolutions thread, which was kind of a bummer ... :( ).

PostPosted: Sun Nov 09, 2003 12:33 am
by Straylight
Just had a look at the email script and it's a jungle. Technically before the spoilers changed the problem should have still been there -- I don't think the emailer bothers to parse out tags. I'm gonna leave it as is for the moment because I have no idea how this script works. ;)

PostPosted: Sun Nov 09, 2003 8:46 am
by shooraijin
If it's in Perl (crosses fingers), or even if it's still PHP albeit with the Perl regular expressions package compiled in, something like this should work:

s/\[spoiler[^]]*\][^[]*\[\/spoiler[^]]*\]//sig;

However, I notice there are no vB code tags in the E-mails that are sent out anyway, so something must be pulling them.

Maybe you could piggyback on the code that yanks out quotations, since those definitely don't appear in the E-mail messages (which led to some private hilarity when I was unable to figure out the context of a few messages a while ago).

PostPosted: Sun Nov 09, 2003 8:47 am
by shooraijin
... just realized it wouldn't work for escaped brackets inside vB code blocks, but you get the idea :)

PostPosted: Sun Nov 09, 2003 11:52 am
by Saint
Yes, i can see how e-mail spoilers can be a problem. They have been like that even before the new spoiler method was up. Ash's post about the Matrix really caught my eye when i read that e-mail. I was like "I can't believe she just said that?!?" then you link to it and see its in a spoiler box... too bad for people who didn't know and read the e-mail.

PostPosted: Sun Nov 09, 2003 1:06 pm
by Straylight
Maybe you could piggyback on the code that yanks out quotations, since those definitely don't appear in the E-mail messages (which led to some private hilarity when I was unable to figure out the context of a few messages a while ago).


That would definatly be the best plan, however I can't actually find the code that removes quotes from emails. It's a total jungle -- each file has a set of includes and those includes can have more includes ... :stressed: :stressed: :stressed: Everything is written in php, and the email script doesn't contain any regular expressions at all.

I'll find it eventually.