Jump to:

4945 Posts in 17751 Topics by 1494 members

Installing SilverStripe

SilverStripe Forums » Installing SilverStripe » Strange error in SSView.php

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

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

Page: 1
Go to End
Author Topic: 1038 Views
  • Tobbe
    Community Member
    25 Posts

    Strange error in SSView.php Link to this post


    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?

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.