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.

Installing SilverStripe /

Getting SilverStripe up and running on your computer and on your web server.

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

Strange error in SSView.php

Go to End



Community Member, 25 Posts

3 January 2009 at 1:35am

Edited: 03/01/2009 1:35am


I have installed SS a lot of times and it has always worked without problems. But last week I tried to install SS 2.2.3 (fresh download from this site) on a new host (PHP Version 5.1.6) I got blank pages after I had passed the Install steps.
Tried flushing and everything I could think of :-) Then I went into dev mode and saw the error. It complied about a missing parenthesis in SSView.php on line 305 (I think it was).
Orginal file:

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

I replaced it with:

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

All I did was changing a ')' to '\)' and it worked.
Is this correct from the beginning or is it my version of PHP that has some bug in the ereg functions?