Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

weird characters in cms


Go to End
Reply

14 Posts   14772 Views

Avatar
schellmax

18 May 2008 at 1:28am (Last edited: 18 May 2008 1:56am), Community Member, 126 Posts

hello,
after installing silverstripe on a client's server, weird characters are showing up in the cms.
unfortunately uploading attachments in this forum seems to be buggy - i can't.
the characters appear just before any html-code (even before doctype declaration), they change every time i log in, always 4 characters like 'ad28'.
the frontend site itself is clean.
has anybody an idea where this may come from or maybe a starting point where to search for a possible problem?
thanks in advance

Avatar
schellmax

21 May 2008 at 5:42am Community Member, 126 Posts

after several hours on irc (many thanks to all folks there) on many more hours alone on my own, i finally found a fix for this (ss version 2.2.1).
in fact i don't know what exactly causes this error, maybe a bug in php version 5.2.5?
to fix it do the following:

file: sapphire/core/Requirements.php
line: 183
todo: before ‘return’ statement, add a line with ‘echo ” “‘
– and –
file: cms/code/LeftAndMain.php
line: 205
todo: before ‘return’ statement, add a line with ‘echo ” “‘

this is just a workaround, any further description/fix for this problem is appreciated.

Avatar
Tim

21 May 2008 at 10:33am Core Development Team, 201 Posts

Thanks for the bug report, I've added to the bug tracker @

http://open.silverstripe.com/ticket/2529

Avatar
schellmax

28 May 2008 at 10:27pm Community Member, 126 Posts

finally, the characters even arrived in the frontend site itself.
this allows me specify the problem a little better:
the characters seem to appear whenever a string is returned by some method and integrated in the html output. in addition, the string must have reached a critical length (i can't determine the exact limit).
whenever you 'echo' some string before the return statement, the characters are gone.
i was wondering wheter this has to do something with output buffering.

Avatar
Sean

7 June 2008 at 4:42pm Forum Moderator, 921 Posts

This is some odd behaviour indeed, something that I've noticed before on another SS installation as a similar problem (a strange character left above the <?php tag on a class), but haven't personally come across it myself.

Have you tried removing all your custom project code, to leave a bare SS installation? This could help pinpoint exactly where the problem is occurring.

Typically this is a good way of debugging if you've got a problem like this, as it's not actually giving any errors! (d'oh!).

Avatar
schellmax

9 June 2008 at 10:11pm Community Member, 126 Posts

i removed all of my code and even did a fresh install - didn't solve the problem.
i expected this, as my workaround (see previous posts) deals with untouched core files, although project code may suffer from the same problem in case a method returns something integrated in the final html output (as mentioned before)...

Avatar
mandrew

13 June 2008 at 10:24am Core Development Team, 32 Posts

This looks suspiciously like the chunk-size characters that HTTP chunked transfers add to the stream.

For this reason, I suspect that this is happening because of a quirk in your web server configuration. Could you tell us a bit more about the web server that you're running on?

* Apache, or something else? What version? Any non-standard modules running?
* What version of PHP?
* What operating system?

If you could email me some details (to sam at silverstripe dot com) of where your server is running so that I could access the site myself, I could take a look at the raw HTTP output to see if I can determine what's wrong.

Avatar
Sam

13 June 2008 at 11:35am Administrator, 679 Posts

Heh, that last post was from me - I was logged in as Mike! Sorry about the identity theft, Mike. ;-)

Go to Top