I have been trying to make the ss3 dev site I am running in a subdirectory have correct template references by using this in my templates:
<script src="{$BaseHref?}{$ThemeDir?}/blahblah.js"></script>
or more correctly now:
<script src="{$AbsoluteBaseURL}{$ThemeDir?}/blahblah.js"></script>
However both fail because a PHP_EOL is being appended to the URL thus breaking the line and therefore the link.
I thought I had traced this to function Text__finalise() in SSTemplateParser.php.inc but this appears not to be the case. I thus far have failed to find the source. Note that the $ThemeDir? does not have the CRLF appended and the output directly from Director:absoluteBaseURL() seems fine.
Interesting that it's CRLF appended because I am testing on Windoze but serving from linux. The files are linux correct as far as I am aware.
Needless to say I have scoured the place for \r\n as well.
I have put this in Trac too.
Stop press. I tracked it to the casting in SSviewer using default casting (HTMLText) for the array in get_template_global_variables() in Director.php. I believe this should be 'Text' and I have altered the array in Director.php as follows:
public static function get_template_global_variables() {
return array(
'absoluteBaseURL' => array('method' => 'absoluteBaseURL', 'casting' => 'Text'),
'baseURL' => array('method' => 'baseURL', 'casting' => 'Text'),
'is_ajax',
'isAjax' => 'is_ajax',
'BaseHref' => 'absoluteBaseURL', //@deprecated 3.0
);
}