Weird thing with "Quote the last message"

For you to give feedback to the Heartland moderators. Wish lists, fault reports, etc. You may get an answer, you may not. As in all things, it largely depends on how nicely you ask the people in charge... You're welcome.
Post Reply
User avatar
markfiend
goriller of form 3b
Posts: 21182
Joined: 11 Nov 2003, 10:55
Location: st custards
Contact:

Whenever I click on the "Quote the last message" when I'm quoting what Steve (Spiggy's Hat) has posted, rather than coming up like this:

=====
Spiggy's hat wrote:Spiggy's Hat's Post
markfiend's reply
=====

... it comes up like this:

=====
[quote="Spiggy markfiend's reply
=====

I presume it's something to do with the ' commenting out the rest of the line in the php code?
The fundamental cause of the trouble is that in the modern world the stupid are cocksure while the intelligent are full of doubt.
—Bertrand Russell
User avatar
Quiff Boy
Herr Administrator
Posts: 16827
Joined: 25 Jan 2002, 00:00
Location: Lurking and fixing
Contact:

now that is wierd.

does it work ok for usernames with no single quote in?
What’s the difference between a buffalo and a bison?
User avatar
markfiend
goriller of form 3b
Posts: 21182
Joined: 11 Nov 2003, 10:55
Location: st custards
Contact:

Yup. It only seems to do it to Steve's posts. It's the single quote isn't it?
The fundamental cause of the trouble is that in the modern world the stupid are cocksure while the intelligent are full of doubt.
—Bertrand Russell
User avatar
Quiff Boy
Herr Administrator
Posts: 16827
Joined: 25 Jan 2002, 00:00
Location: Lurking and fixing
Contact:

i reckon.

will do some digging and see what i can find.
What’s the difference between a buffalo and a bison?
User avatar
lazarus corporation
Lord Protector
Posts: 3449
Joined: 09 May 2004, 17:42
Location: out there on a darkened road
Contact:

single quotes are comments in ASP not PHP. PHP uses either

// for a single line comment or

/*
these things
for multiple line comments
*/
Spiggy's hat wrote:Spiggy's Hat's Post
seems ok to me
Last edited by lazarus corporation on 18 May 2005, 14:01, edited 1 time in total.
User avatar
lazarus corporation
Lord Protector
Posts: 3449
Joined: 09 May 2004, 17:42
Location: out there on a darkened road
Contact:

lazarus corporation wrote:single quotes are comments in ASP not PHP.
Spiggy's hat wrote:Spiggy's Hat's Post
seems ok to me
and again
User avatar
Quiff Boy
Herr Administrator
Posts: 16827
Joined: 25 Jan 2002, 00:00
Location: Lurking and fixing
Contact:

lazarus corporation wrote:
lazarus corporation wrote:single quotes are comments in ASP not PHP.
Spiggy's hat wrote:Spiggy's Hat's Post
seems ok to me
and again
wierd.

i found a post in the weeding section where steve was the last person to reply to it.

i write "this is a test" in the quick reply box at the bottom, ticked the box for "Quote the last message" and hit preview.

i got exactly what mark got, time and time again...

if you view the source of this page, right at the bottom - the form field tags use single quotes

Code: Select all

<input type='hidden' name='message' value='' />

<input type='hidden' name='last_msg' value='&#91;QUOTE="lazarus corporation"&#93;.....'>
etc

i reckon its getting screwed there - doesnt know what single quote is part of the name, or the message, and what is part of the html tag.
What’s the difference between a buffalo and a bison?
User avatar
markfiend
goriller of form 3b
Posts: 21182
Joined: 11 Nov 2003, 10:55
Location: st custards
Contact:

It will get this:

Code: Select all

<input type='hidden' name='message' value='' />

<input type='hidden' name='last_msg' value='&#91;QUOTE="Spiggy's Hat"&#93;.....'>
and so it interprets it as

Code: Select all

<input type='hidden' name='last_msg' value='&#91;QUOTE="Spiggy' _random characters the html parser can't understand so ignores_ >
I think...
The fundamental cause of the trouble is that in the modern world the stupid are cocksure while the intelligent are full of doubt.
—Bertrand Russell
User avatar
Quiff Boy
Herr Administrator
Posts: 16827
Joined: 25 Jan 2002, 00:00
Location: Lurking and fixing
Contact:

eggsakkerly
What’s the difference between a buffalo and a bison?
User avatar
markfiend
goriller of form 3b
Posts: 21182
Joined: 11 Nov 2003, 10:55
Location: st custards
Contact:

If you changed SH's login name to Spiggy&#39;s Hat would he still be able to log in normally? Because that would sort it I think.
Having just looked up the ASCII for the apostrophe

And trying to stop &#39; showing up as '
The fundamental cause of the trouble is that in the modern world the stupid are cocksure while the intelligent are full of doubt.
—Bertrand Russell
User avatar
lazarus corporation
Lord Protector
Posts: 3449
Joined: 09 May 2004, 17:42
Location: out there on a darkened road
Contact:

you wouldn't have to change his name in the database, just implement a Regex to find ' and replace with &#39; when writing the HTML.
Last edited by lazarus corporation on 18 May 2005, 16:22, edited 3 times in total.
User avatar
Quiff Boy
Herr Administrator
Posts: 16827
Joined: 25 Jan 2002, 00:00
Location: Lurking and fixing
Contact:

i hate regexs :urff:
What’s the difference between a buffalo and a bison?
User avatar
lazarus corporation
Lord Protector
Posts: 3449
Joined: 09 May 2004, 17:42
Location: out there on a darkened road
Contact:

I used to hate them, but I'm started to be lured in by how powerful they can be.
User avatar
CellThree
Slight Overbomber
Posts: 1730
Joined: 14 Feb 2003, 22:05
Contact:

You guys are so dull :lol:
24.24.2.489 Deceased
User avatar
lazarus corporation
Lord Protector
Posts: 3449
Joined: 09 May 2004, 17:42
Location: out there on a darkened road
Contact:

you love it really
User avatar
Quiff Boy
Herr Administrator
Posts: 16827
Joined: 25 Jan 2002, 00:00
Location: Lurking and fixing
Contact:

that should be sorted now ;)

for those that care, the solution was::

Find this line added to viewtopic.php:
$last_msg = str_replace("'", "&#39;", $last_msg);
After it, add:
$last_poster = str_replace("'", "&#39;", $last_poster);
thanks to thoul on phpbbhacks :notworthy:
What’s the difference between a buffalo and a bison?
User avatar
lazarus corporation
Lord Protector
Posts: 3449
Joined: 09 May 2004, 17:42
Location: out there on a darkened road
Contact:

you might need to add the same string replacement code to the PM facility as well.
Post Reply