Ticket #2529 (closed defect: fixed)

Opened 5 months ago

Last modified 2 weeks ago

Wierd characters in CMS

Reported by: tcopeland Assigned to: sminnee
Type: defect Priority: medium
Milestone: 2.3.0 Component: (Unknown)
Version: 2.2.1 Severity: medium effort / impact
Keywords: Cc: hamish
Due date: Hours:

Attachments

bug_chars.jpg (33.3 kB) - added by schellmax 5 months ago.
screenshot of cms

Change History

Changed 5 months ago by schellmax

screenshot of cms

Changed 2 months ago by hamish

BUMP

I'm seeing this on the silverstripe homepage. Screenshot of http://silverstripe.com/community-overview/

See: http://silverstripe.com/assets/Attachments/ss-fail.png

Forum post: http://silverstripe.com/extending-hacking-silverstripe-forum/flat/148829

Changed 2 months ago by hamish

Note that this seems to happen when viewing a SS site through a firewall.

Changed 1 month ago by sminnee

  • owner changed from aoneil to sminnee

There is some problem with our HTTP headers. We'll need to find out which proxy server is causing the problems and then test different combinations of headers to see what works.

Changed 2 weeks ago by hamish

More info:

Try using this page to check the ouput of a silverstripe site through a proxy:

http://www.rexswain.com/cgi-bin/httpview.cgi

For example, analysing http://silverstripe.com/widgets/ shows the following:

Content (Length = 43758):
aae1(CR)(LF)
<!DOCTYPE·html·PUBLIC·"-//W3C//DTD·XHTML·1.1//EN"·"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">(LF)
<html·xmlns="http://www.w3.org/1999/xhtml"·xml:lang="en"·>(LF)
(HT)<head>(LF)
(HT,HT)<base·href="http://silverstripe.com/"·/>(LF)
(HT,HT)<title>Widgets</title>(LF)
<meta·name="generator"·http-equiv="generator"·content="SilverStripe·2.0·-·http://www.silverstripe.com"·/>(LF)
<meta·http-equiv="Content-type"·content="text/html;·charset=utf-8"·/>(LF)
<meta·http-equiv="Content-Language"·content="en"/>(LF)
...

After a bit of reading, found this post about a possible related issue with Drupal and Squid proxies. It seems that if the client requests encoding as http 1.0 and the response is sent in 1.1, you might get the effect I'm seeing.

see also a very similar ticket for wordpress.

The solution in their case was to remove the http hardcoding. In silverstripes case, it means modifying the following line in HTTPResponse.php:

header("HTTP/1.1 $this->statusCode " . self::$status_codes[$this->statusCode]);

to

header($_SERVER["SERVER_PROTOCOL"]." $this->statusCode " . self::$status_codes[$this->statusCode]);

I'm not able to test this at the moment, will do so when possible, but if anyone has a site that is effected maybe they'd like to try it out.

Changed 2 weeks ago by sminnee

  • cc set to hamish
  • milestone set to 2.3.0

Legend! Thanks for figuring out this really nasty error.

Changed 2 weeks ago by hamish

Hey, I noticed today that silvestripe.com was looking much nice in IE7 - have you applied the change there? Yay! :D

Changed 2 weeks ago by sminnee

  • status changed from new to closed
  • resolution set to fixed

Yeah, I was using that to check it worked properly :-)

Fixed on trunk in r63304.

Note: See TracTickets for help on using tickets.