Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Snitz Forums 2000 DEV-Group
 DEV Bug Reports (Closed)
 BUG+FIX (All) Double Quote Bug
 Forum Locked  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Syedur
New Member

USA
93 Posts

Posted - 22 June 2001 :  01:34:22  Show Profile  Visit Syedur's Homepage  Send Syedur an AOL message  Send Syedur an ICQ Message  Send Syedur a Yahoo! Message
Did anyone noticed that...
When you have something around double quotes in the subject line...
Later on, when you try to edit the topic (as a mod/admin), the subject line doesn't have the words visible after the quotes...
Try editing my post's subject...
Thanks.


There is a time in every man’s education when he arrivers at the conviction that envy is ignorance; that imitation is suicide.

work mule
Senior Member

USA
1358 Posts

Posted - 22 June 2001 :  17:49:59  Show Profile
Hmm...I checked the beta and it's still not working there either.

Basically, whenever someone types doublequotes into an input box and then is allowed to edit it later, if it has the doublequotes, then the text appears to be truncated at that spot.

If someone with rights to edit the topics at either one of these sites looks at the subject line upon edit, you'll see it gets truncated.

She said, "Send me flowers!"

appears as

She said,

because the html is now

<input maxLength="50" name="Subject" value="She said, "Send me flowers!"" size="40">

So the browser sees that second doublequote and thinks the attribute value stops there.

Beta Snitz
http://forum.snitz.com/beta/v33/topic.asp?TOPIC_ID=22

Current Snitz
http://forum.snitz.com/forum/link.asp?TOPIC_ID=11819




The Work Mule Forums
The Writer Community
Go to Top of Page

gor
Retired Admin

Netherlands
5511 Posts

Posted - 22 June 2001 :  17:57:55  Show Profile  Visit gor's Homepage
So in this case we should make a difference between displaying a string as part of plain HTML and as part of a formelement.
In the case of a input element we need to replace " with "" (but not ' with '') when it is displayed.

Correct ?


Pierre
Join the Snitz WebRing
Go to Top of Page

work mule
Senior Member

USA
1358 Posts

Posted - 22 June 2001 :  18:06:32  Show Profile
Well, it's only for input form elements. The textarea uses the tags to start and end, while the input form element uses the " to mark the start and end of the attribute value. This applies to hidden tags also.

If you use " to mark attributes then you have to convert ", but if you use the ' then you have to convert that mark. So it depends on how you mark your attributes.

I think all you have to do is the following, depending on which character you use to mark attributes. It's similiar to the idea of escaping characters in Javascript or Perl, but the HTML way.
" to & #034;
' to & #039;

(I had to put a space between the & and # to get it to show.)

quote:

And, like I asked at the other topic: did you ?


No, but if I spend too much time here, I'll have to.



The Work Mule Forums
The Writer Community


Edited by - work mule on 22 June 2001 18:08:00
Go to Top of Page

work mule
Senior Member

USA
1358 Posts

Posted - 22 June 2001 :  18:53:31  Show Profile
Maybe something like this, but take the spaces out after the ampersand (&) for the HTML entity code.


function FormEncode(ByVal fString)
If IsNull(fString) Then exit function
fString = replace(fString, ">", "& gt;")
fString = replace(fString, "<", "& lt;")
fString = replace(fString, chr(34), "& #034;")

FormEncode = fString
end function




The Work Mule Forums
The Writer Community
Go to Top of Page

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 22 June 2001 :  19:27:06  Show Profile
What I did was add this to the Chkstring function:

	if fField_Type = "edit" then
if strAllowHTML <> "1" then
fString = HTMLEncode(fString)
end if
fString = Replace(fString, """", "&quot;")
ChkString = fString
exit function
end if


And this is how it looks in post.asp:

        <td bgColor="<% =strPopUpTableColor %>"><input maxLength="50" name="Subject" value="<% =Trim(ChkString(TxtSub,"edit")) %>" size="40"></td>



You can try it HERE

Just login as NewUser/newuser and then edit the message.
Go to Top of Page

HuwR
Forum Admin

United Kingdom
20584 Posts

Posted - 25 June 2001 :  12:14:12  Show Profile  Visit HuwR's Homepage
Implemented in current source

Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.15 seconds. Powered By: Snitz Forums 2000 Version 3.4.07