x
This website is using cookies. We use cookies to ensure that we give you the best experience on our website. More info. That's Fine
HPC:Factor Logo 
 
Latest Forum Activity

Bugreport: Forum newline parsing error with hv3 web browser

i336_ Page Icon Posted 2014-03-14 12:18 AM
#
Avatar image of i336_
H/PC Newbie

Posts:
22
Location:
Australia
Status:
Thanks to its near-zero CPU and low RAM usage, I sometimes use the hv3 web browser to open Gmail. I just got a message alert and decided to try replying in hv3, only to find the newlines in my post not showing up. I checked if it was hv3's fault by TCP-sniffing a post preview; it isn't - and if I go to edit my post the newlines reappear in the textbox perfectly. The forum needs to interpret the three bytes "%0A" as a newline. Here are a few (currently invisible ) newlines to play with in these brackets: [ ] -i336

Edited by i336_ 2014-03-14 12:19 AM
 Top of the page Quote Reply
C:Amie Page Icon Posted 2014-03-14 8:33 AM
#
Avatar image of C:Amie
Administrator
H/PC Oracle

Posts:
17,950
Location:
United Kingdom
Status:
The one byte LF is parsed as the defacto new line character from html text boxes, 0x0D 0x0A is the windows line break standard, which contains 0x0D while Unix type systems will just send 0x0D. Either way, 0x0A will be seen. Therefore something else is going on assuming that you are sending it inside the correct encoding standard.
 Top of the page Quote Reply
i336_ Page Icon Posted 2014-03-14 9:38 AM
#
Avatar image of i336_
H/PC Newbie

Posts:
22
Location:
Australia
Status:
Okay, I took a look at the actual data going over the wire when I clicked Preview, and learned something rather perplexing.

Request (<...>'d bits removed "just in case" ):
POST /forums/forums/thread-post.asp?action=postreply HTTP/1.1 
Host: www.hpcfactor.com 
Content-Length: 216
Accept: */*
User-Agent: Mozilla/5.1 (X11; U; Linux i686; en-US; rv:1.8.0.3) Gecko/20060425 SUSE/1.5.0.3-7 Hv3/alpha
Referer: http://www.hpcfactor.com/forums/forums/thread-view.asp?tid=1...
Cookie: <...>; bbsmid=29178; password=<...>; guestID=; guestStart=;
Content-Type: application/x-www-form-urlencoded
Connection: keep-alive

fid=47&replyto=157645&mid=-1&filtercrlf=&subject=Re%3A+Bugreport%3A+Forum+newline+parsing+error+with+hv3+web+browser&messagebody=Here+are+some+newlines%3A+%5B%0A%0A%0A%0A%0A%0A%0A%0A%0A%5D&emoticons=1&preview=Preview
Response:
HTTP/1.1 200 OK 
Cache-Control: private
Content-Length: 29348
Content-Type: text/html
Expires: Fri, 14 Mar 2014 09:05:50 GMT
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
Date: Fri, 14 Mar 2014 09:06:50 GMT

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

(snip)

<td valign='top' class='messagemiddle'><div class="messageMainBody">Here are some newlines: [







]</div></td>

(snip)

<td valign='top' class='messagecellbody' width='90%'><textarea style='width:95%' rows='20' cols='80' class='bbseditbox' name='messagebody' id='messagebody'>Here are some newlines: [








]</textarea></td>
Notice anything wrong with this picture?

The lower <textarea> should have literal newlines in it (combinations of 0x0D and/or 0x0A - that makes sense.

...But the <div> has literal newlines in it too (?)! No can haz any <br />s!

The above is a direct copy from Wireshark; I've attached the compressed dump of hv3's form POST and the site's response (pretty much the above plus the rest of the page HTML).

As an irritating aside, if you submit an &lt; or an &gt, the forum will reformat it into a literal < or > in the preview box once the preview has been submitted. This makes submitting HTML mixed in with "no thanks I want that as text" a case of while(editing) { preview(); click_back(); }

-i336
 Top of the page Quote Reply
i336_ Page Icon Posted 2014-03-14 9:39 AM
#
Avatar image of i336_
H/PC Newbie

Posts:
22
Location:
Australia
Status:
Okay, I took a look at the actual data going over the wire when I clicked Preview, and learned something rather perplexing.

Request (<...>'d bits removed "just in case" ):
POST /forums/forums/thread-post.asp?action=postreply HTTP/1.1 
Host: www.hpcfactor.com 
Content-Length: 216
Accept: */*
User-Agent: Mozilla/5.1 (X11; U; Linux i686; en-US; rv:1.8.0.3) Gecko/20060425 SUSE/1.5.0.3-7 Hv3/alpha
Referer: http://www.hpcfactor.com/forums/forums/thread-view.asp?tid=1...
Cookie: <...>; bbsmid=29178; password=<...>; guestID=; guestStart=;
Content-Type: application/x-www-form-urlencoded
Connection: keep-alive

fid=47&replyto=157645&mid=-1&filtercrlf=&subject=Re%3A+Bugreport%3A+Forum+newline+parsing+error+with+hv3+web+browser&messagebody=Here+are+some+newlines%3A+%5B%0A%0A%0A%0A%0A%0A%0A%0A%0A%5D&emoticons=1&preview=Preview
Response:
HTTP/1.1 200 OK 
Cache-Control: private
Content-Length: 29348
Content-Type: text/html
Expires: Fri, 14 Mar 2014 09:05:50 GMT
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
Date: Fri, 14 Mar 2014 09:06:50 GMT

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

(snip)

<td valign='top' class='messagemiddle'><div class="messageMainBody">Here are some newlines: [







]</div></td>

(snip)

<td valign='top' class='messagecellbody' width='90%'><textarea style='width:95%' rows='20' cols='80' class='bbseditbox' name='messagebody' id='messagebody'>Here are some newlines: [








]</textarea></td>
Notice anything wrong with this picture?

The lower <textarea> should have literal newlines in it (combinations of 0x0D and/or 0x0A - that makes sense.

...But the <div> has literal newlines in it too (?)! No can haz any <br />s!

I'm wondering... you mentioned encoding, yet I don't see any references in the request. Maybe that's what's doing it?

At any rate, the above is a direct copy from Wireshark; I've attached the compressed dump of hv3's form POST and the site's response (pretty much the above plus the rest of the page HTML).

As an irritating aside, if you submit an &lt; or an &gt, the forum will reformat it into a literal < or > in the preview box once the preview has been submitted. This makes submitting HTML mixed in with "no thanks I want that as text" a case of while(editing) { preview(); click_back(); }

-i336



Attachments
----------------
Attachments hv3.pcap.xz (7KB - 0 downloads)
 Top of the page Quote Reply
C:Amie Page Icon Posted 2014-03-14 10:50 AM
#
Avatar image of C:Amie
Administrator
H/PC Oracle

Posts:
17,950
Location:
United Kingdom
Status:
I'm on a train right now and cannot look into it further, however 0x0A in the response stream aren't uxpected given that most iterators in the template system on the site terminate all markup lines with 0x0A0D. Given that you are the only person to have mentioned this in 14 years, my current purely a guess would be that your browser renderer doesn't know what to do with a carriage return.

Until i have more info...
 Top of the page Quote Reply
Jump to forum:
Seconds to generate: 0.218 - Cached queries : 44 - Executed queries : 29