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.

Upgrading SilverStripe /

Ask questions about upgrading SilverStripe to the latest version.

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

"Unexpected character in input..." error


Reply


7 Posts   1611 Views

Avatar
SightUnseen

Community Member, 28 Posts

19 May 2010 at 11:49am

Edited: 19/05/2010 11:50am

After upgrading from 2.3.3 to 2.4.0 the following is shown:

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/trainer/public_html/sapphire/core/SSViewer.php on line 304

This appeared after a rebuild was carried out. Now it is not possible to do another, as attempts to login fail.

Can anyone suggest the fix for this? The relevant block is:

      $content = ereg_replace('<' . '% +_t\((\'([^\.\']*)\'|"([^\."]*)")(([^)]|\)[^ ]|\) +[^% ])*)\) +%' . '>', '<?= _t(\''. $identifier . '.ss' . '.\\2\\3\'\\4) ?>', $content);

Avatar
Bruce B

Community Member, 147 Posts

21 May 2010 at 5:24pm

Try adding your current domain to the list of dev servers in your _config.php file. That way you can see what error message you get on a rebuild without needing to log in.

Avatar
SightUnseen

Community Member, 28 Posts

25 May 2010 at 3:36pm

Edited: 25/05/2010 3:42pm

Thanks Bruce, have done so and see in red:

user_error('DataObjectDecorator::extraDBFields() is deprecated. Please use extraStatics() instead.', E_USER_NOTICE);

To be honest, an upgrade shouldn't be this difficult. We have also tried a fresh install on a test server, then imported the database, which worked fine. However upon adding Blog, the User Form, and Mollum modules the same error arises. We've also asked this question a couple of times in the IRC channel and looked through the forums and help section, but it all appears support is targeted to advanced php developers only.

Avatar
shan

Community Member, 3 Posts

26 May 2010 at 5:38am

Had the exact same issue. Upgrade from 2.33 to 2.40. Same situation same error message. (On a Networksolutions host, not sure if this matters). Had to restore to 2.33. Searched on the Internet, found this post and another post answered in Germany...
Thanks in advance!

Avatar
Cristian

Community Member, 8 Posts

4 June 2010 at 4:15am

make sure the ASP_TAG is OFF. that was the cause of my problem

Also, some other config can cause this error :
/tmp folder not writable.
and safe_mod is on.

<?php

echo "TMP is_writable: " . is_writable("/tmp") . "<br />";
echo "SafeMode: " . ini_get('safe_mode') . "<br />";
echo "asp_tags: " . ini_get('asp_tags') . "<br />";

phpinfo();
?>

if that can help.

-Cristian

Avatar
shan

Community Member, 3 Posts

4 June 2010 at 8:50am

Worked! Thanks Cristian!
ASP_TAG was on. Since I'm on a shared hosting with Networksolutions. I did this to turn it off: create the php.ini file under cgi-bin folder with only one line: asp_tag=Off.
Unfortunately I had problems with my custom form after upgrading and had to downgrade AGAIN...

Avatar
SightUnseen

Community Member, 28 Posts

2 July 2010 at 3:41pm

This is now fixed, thanks to pelse here: http://www.silverstripe.org/installing-silverstripe/show/286353

Thank you to all those who contributed.