The Gaming Den Forum Index The Gaming Den
Welcome to the Gaming Den.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Google
 Search WWW   Search tgdmb.com 
Wednesday night maintenance

 
Post new topic   Reply to topic    The Gaming Den Forum Index -> About the Gaming Den
View previous topic :: View next topic  
Author Message
Zherog
Knight-Baron


Joined: 07 Mar 2008
Posts: 828

PostPosted: Mon Jul 28, 2014 2:03 am    Post subject: Wednesday night maintenance Reply with quote Add User to Ignore List

Nockermensch was kind enough to take a look at the code that writes posts to the database, and he believes he was able to correct the ever-annoying bug that causes missing quote tags to fuck up the format of the entire page. The code looks solid to me, but unfortunately I'm going to have to experiment with it in "production" to verify it works. So...

Wednesday around 10pm EDT I'm going to install the new code, and then run a test or two. If things go to hell in a handbasket quickly I'll undo the changes and revert to the prior version as quickly as possible. If things seem to be OK after I install the new code, I intend to leave it in place, and I'll keep checking in every few minutes over the next couple hours after that to make sure nobody else ran into weird trouble.

If somebody encounters any sort of error while making or editing a post after 10pm Wednesday, please include as much detail as possible here. Also, please do not attempt to verify the bug is fixed right away - if something is wrong, I'll find it quick enough after installing, and having everybody submit a "bad" post just to verify it's fixed won't be good if there's something else wrong.

Thank in advance for your patience on Wednesday evening.
_________________
You can't fix stupid.

"A life is not important except in the impact it has on other lives." ~ Jackie Robinson
Back to top
View user's profile Send private message Send e-mail
Zherog
Knight-Baron


Joined: 07 Mar 2008
Posts: 828

PostPosted: Thu Jul 31, 2014 2:07 am    Post subject: Reply with quote Add User to Ignore List

test post #1
_________________
You can't fix stupid.

"A life is not important except in the impact it has on other lives." ~ Jackie Robinson
Back to top
View user's profile Send private message Send e-mail
Zherog
Knight-Baron


Joined: 07 Mar 2008
Posts: 828

PostPosted: Thu Jul 31, 2014 2:08 am    Post subject: Reply with quote Add User to Ignore List

Quote:

And this post is being submitted with a broken close-quote tag on purpose
[/quote

And we'll see what happens...

_________________
You can't fix stupid.

"A life is not important except in the impact it has on other lives." ~ Jackie Robinson


Last edited by Zherog on Thu Jul 31, 2014 2:10 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
Zherog
Knight-Baron


Joined: 07 Mar 2008
Posts: 828

PostPosted: Thu Jul 31, 2014 2:09 am    Post subject: Reply with quote Add User to Ignore List

And... that looks about right.

So, the code is pretty simple overall. If there are more open tags than close tags, it simply adds close tags until there are the same number of each. It does this right before submitting the post to the database. I'll do a few more tests, and I'll be around for about an hour or so. If anybody runs into an issue while posting, please let me know here.
_________________
You can't fix stupid.

"A life is not important except in the impact it has on other lives." ~ Jackie Robinson
Back to top
View user's profile Send private message Send e-mail
Sam
Journeyman


Joined: 14 Jul 2014
Posts: 111

PostPosted: Thu Jul 31, 2014 2:25 am    Post subject: Reply with quote Add User to Ignore List

Quote:
Quick test.


Last edited by Zherog on Thu Jul 31, 2014 2:31 am; edited 1 time in total
Back to top
View user's profile Send private message
Zherog
Knight-Baron


Joined: 07 Mar 2008
Posts: 828

PostPosted: Thu Jul 31, 2014 2:32 am    Post subject: Reply with quote Add User to Ignore List

So... looks like the code only fixes when there are more open tags than close tags. So, improvement but not perfect. I should be able to tweak the fix to cover both scenarios, but not tonight - my mind is too much goo to concentrate tonight.
_________________
You can't fix stupid.

"A life is not important except in the impact it has on other lives." ~ Jackie Robinson
Back to top
View user's profile Send private message Send e-mail
fbmf
The Great Fence Builder


Joined: 07 Mar 2008
Posts: 2514

PostPosted: Thu Jul 31, 2014 2:06 pm    Post subject: Reply with quote Add User to Ignore List

We appreciate it, Z.

[/The Great Fence Builder Speaks]
Back to top
View user's profile Send private message
Zherog
Knight-Baron


Joined: 07 Mar 2008
Posts: 828

PostPosted: Thu Jul 31, 2014 2:09 pm    Post subject: Reply with quote Add User to Ignore List

Props to nockermensch too. He took the initiative to fix the code.
_________________
You can't fix stupid.

"A life is not important except in the impact it has on other lives." ~ Jackie Robinson
Back to top
View user's profile Send private message Send e-mail
Maj
Prince


Joined: 07 Mar 2008
Posts: 4199
Location: Shelton, Washington, USA

PostPosted: Thu Jul 31, 2014 4:24 pm    Post subject: Reply with quote Add User to Ignore List

Thank you, you guys! Majjy Majjy
_________________
My son makes me laugh. Maybe he'll make you laugh, too. Oh, hey! There's now a Minecraft Edition of GODzookery!
Back to top
View user's profile Send private message
Zherog
Knight-Baron


Joined: 07 Mar 2008
Posts: 828

PostPosted: Fri Aug 01, 2014 3:45 am    Post subject: Reply with quote Add User to Ignore List

more testing
_________________
You can't fix stupid.

"A life is not important except in the impact it has on other lives." ~ Jackie Robinson
Back to top
View user's profile Send private message Send e-mail
Zherog
Knight-Baron


Joined: 07 Mar 2008
Posts: 828

PostPosted: Fri Aug 01, 2014 3:45 am    Post subject: Reply with quote Add User to Ignore List

Quote:
and some more

_________________
You can't fix stupid.

"A life is not important except in the impact it has on other lives." ~ Jackie Robinson
Back to top
View user's profile Send private message Send e-mail
Zherog
Knight-Baron


Joined: 07 Mar 2008
Posts: 828

PostPosted: Fri Aug 01, 2014 3:46 am    Post subject: Reply with quote Add User to Ignore List

Quote:
and one more

_________________
You can't fix stupid.

"A life is not important except in the impact it has on other lives." ~ Jackie Robinson
Back to top
View user's profile Send private message Send e-mail
Zherog
Knight-Baron


Joined: 07 Mar 2008
Posts: 828

PostPosted: Fri Aug 01, 2014 3:47 am    Post subject: Reply with quote Add User to Ignore List

OK, I believe the code will now correct the post regardless of whether the tag is missing at the beginning or the end.

As with yesterday, if anybody sees anything weird please post here. I'll be online for the next 30 minutes to an hour, and I'll make a point to refresh in the morning as well.
_________________
You can't fix stupid.

"A life is not important except in the impact it has on other lives." ~ Jackie Robinson
Back to top
View user's profile Send private message Send e-mail
TiaC
Knight-Baron


Joined: 20 Jun 2013
Posts: 902

PostPosted: Fri Aug 01, 2014 4:11 am    Post subject: Reply with quote Add User to Ignore List

Thanks Z!
_________________
virgil wrote:
Lovecraft didn't later add a love triangle between Dagon, Chtulhu, & the Colour-Out-of-Space; only to have it broken up through cyber-bullying by the King in Yellow.

FrankTrollman wrote:
If your enemy is fucking Gravity, are you helping or hindering it by putting things on high shelves? I don't fucking know! That's not even a thing. Your enemy can't be Gravity, because that's stupid.
Back to top
View user's profile Send private message
ACOS
Knight


Joined: 03 Apr 2014
Posts: 414

PostPosted: Fri Aug 01, 2014 4:33 am    Post subject: Reply with quote Add User to Ignore List

It appears that when quoting, shit goes haywire when you actually have the quoted person's name in the tag, e.g., <quote="ACOS">, as opposed to just <quote>
I hit "preview", and everything is fine; but when I submit, it gratuitously adds two more open quote tags at the beginning.

I played around a bit with variations I've seen on other boards, but nothing helped but to just make it a generic quote tag.
_________________
"Civilized men are more discourteous than savages because they know they can be impolite without having their skulls split, as a general thing."
- Robert E. Howard
Back to top
View user's profile Send private message
FrankTrollman
Serious Badass


Joined: 07 Mar 2008
Posts: 26735

PostPosted: Fri Aug 01, 2014 5:10 am    Post subject: Reply with quote Add User to Ignore List

ACOS wrote:
It appears that when quoting, shit goes haywire when you actually have the quoted person's name in the tag, e.g., <quote="ACOS">, as opposed to just <quote>
I hit "preview", and everything is fine; but when I submit, it gratuitously adds two more open quote tags at the beginning.

I played around a bit with variations I've seen on other boards, but nothing helped but to just make it a generic quote tag.


Yes this. It seems to interpret attributed quote tags as missing quote tags and then "fix them" for you by adding in additional open quote tags to the beginning of the post, which makes everything fucked.

-Frank


Last edited by Zherog on Fri Aug 01, 2014 10:58 am; edited 3 times in total
Back to top
View user's profile Send private message
FrankTrollman
Serious Badass


Joined: 07 Mar 2008
Posts: 26735

PostPosted: Fri Aug 01, 2014 5:20 am    Post subject: Reply with quote Add User to Ignore List

Even if you remove the "" in the attributed quotes, it's still fucked.
Even if you add your own attributed quotes in by hand, it's still fucked.
Attributed quotes are just fucked.

-Frank


Last edited by FrankTrollman on Fri Aug 01, 2014 5:22 am; edited 2 times in total
Back to top
View user's profile Send private message
nockermensch
Duke


Joined: 06 Jan 2012
Posts: 1552
Location: Rio: the Janeiro

PostPosted: Fri Aug 01, 2014 6:46 am    Post subject: Reply with quote Add User to Ignore List

What's causing this is the code looking for just [ quote] and not the much more common [ quote="whatever"]. I mailed Zherog a fix for that.
_________________
@ @ Nockermensch

Koumei wrote:
After all, in Firefox you keep tabs in your browser, but in SovietPutin's Russia, browser keeps tabs on you.
Back to top
View user's profile Send private message
Zherog
Knight-Baron


Joined: 07 Mar 2008
Posts: 828

PostPosted: Fri Aug 01, 2014 11:00 am    Post subject: Reply with quote Add User to Ignore List

I've removed the code that adds the open quotes; the fix from nocker didn't seem to resolve it, and I don't have the time or brainpower at the moment to debug and figure it out completely.

I'll play with it some more tonight. But in the meantime the code to add closing tags is still in place.
_________________
You can't fix stupid.

"A life is not important except in the impact it has on other lives." ~ Jackie Robinson
Back to top
View user's profile Send private message Send e-mail
Zherog
Knight-Baron


Joined: 07 Mar 2008
Posts: 828

PostPosted: Fri Aug 01, 2014 11:00 am    Post subject: Reply with quote Add User to Ignore List

Quote:
testing

_________________
You can't fix stupid.

"A life is not important except in the impact it has on other lives." ~ Jackie Robinson


Last edited by Zherog on Fri Aug 01, 2014 11:02 am; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail
DSMatticus
Prince


Joined: 14 Apr 2011
Posts: 4816

PostPosted: Fri Aug 01, 2014 12:22 pm    Post subject: Reply with quote Add User to Ignore List

There are three ways to do a quote tag (e's dropped to avoid making actual tags):
[quot]Stuff[/quot]
[quot=XYZ]Stuff[/quot]
[quot="XYZ"]Stuff[/quot]

The first case is simple enough that I don't think it needs addressing.

In the second case, the first close bracket encountered terminates the quote open tag, and as such XYZ cannot contain a close bracket. Except I just lied to you, and it totally can, because you can put tags inside XYZ (like italics tags or URL tags) and those tags will consume close brackets first. Note it has to be an actual tag that gets recognized, not just gibberish in a pair of brackets.

In the third case, the first quotation mark immediately followed by a close bracket terminates the quote open tag, and as such XYZ can contain any number of close brackets and quotation marks (but not a quotation mark followed immediately by a close bracket). As far as I know, there's no exceptions this time, because the only tag which can end in that particular way is the quote open tag, and worrying about the fact that you can put a quote open tag in the middle of a quote open tag (you really can) is beyond the scope of this fix.

Handling one is simple. They're fixed strings. Match, count, compare, add whichever you need*.

Handling three is almost as simple. There is technically a single variable substring, but its contents are completely irrelevant. Match, count, compare, add whichever you need*.

Handling two requires matching tags so you can actually tell whether or not your quote open tag has its closing bracket or if they've all been consumed.

Yes, I just told you to unleash regex or an equivalently unsophisticated tool on an html derivative. We aren't trying to pair tags, only identify them; the former isn't regular, but the latter is.

*I lied to you again. While it is the case that I can't put tags inside those quote tags that will break the matching, there is at least one tag in which you can put a quote tag that modifies the quote tag's behavior: the code tag, which causes all tags contained therein to be printed as text instead of parsed. If someone puts mismatched quote tags inside a code tag, the code breaks. But this is an edge case that's going to come up a lot less than people fucking their tags (i.e. it will never come up). Also don't forget that the three different kinds of quote open tags all share quote close tags. There's the potential for some some silly double/triple-counting errors there.


Last edited by DSMatticus on Fri Aug 01, 2014 12:26 pm; edited 3 times in total
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    The Gaming Den Forum Index -> About the Gaming Den All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Powered by phpBB © 2001, 2005 phpBB Group