Page 1 of 1

function smarty_function_sitename() not found double slashes [solved]

Posted: Wed May 28, 2008 1:50 am
by lemkepf
This is just a helpful little post on an issue i found today.

The hosting company says the path for the websites was "\\fileshare\home\user\www\". When i put that into the site_root in the config.php file for some reason smarty was throwing errors left and right:

Code: Select all

string(207) "Smarty error: [in template:17 line 9]: [plugin] function smarty_function_sitename() not found in \fileshare\home\user\www\cmsms/plugins\function.sitename.php (core.load_plugins.php, line 75)"
Notice that the path it listed only had one of those slashes? In my root_url i change the "\\fileshare" to "\\\\fileshare" and that solved the issue.

I believe the double slashes were being replaced by either smarty or another piece of code. Anyways, thanks Ted and SJG for the help!

Paul

Re: function smarty_function_sitename() not found double slashes [solved]

Posted: Wed May 28, 2008 2:01 am
by Wiedmann
In my root_url i change the "\\fileshare" to "\\\\fileshare" and that solved the issue.
That's normal PHP behaviour (read the PHP manual how single quoted strings are working).
--> In a  double of backslashs, the first  backslash always escapes the following backslash to have one literal. Thus a '\\' results in '\' and for '\\' you must use '\\\\'.

BTW:
For filepaths it's better to use allways "/" (with every OS).