|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
dleffler Smarty Rookie
Joined: 20 Sep 2011 Posts: 8
|
Posted: Sat Dec 19, 2015 11:34 am Post subject: Upgrading to 3.1.28 woes |
|
|
Some issues/quirks I've noted when upgrading to v3.1.28 (from 3.1.27), at least on a windows based system:
The new _realpath function tends to add a full path onto a passed full path setPluginsDir() during processing (making it an invalid path) such as when adding plugins/filters since, though it was passed a unix 'separater' '/', it assumes that the paths it was given must match the OS, which for windows the separator is '\'
And, for a custom filter plugin, the internal variable used WAS $this->registerfilter(), but now must be $smarty->registerfilter() |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Sat Dec 19, 2015 3:37 pm Post subject: Re: Upgrading to 3.1.28 woes |
|
|
dleffler wrote: | it was passed a unix 'separater' '/', it assumes that the paths it was given must match the OS, which for windows the separator is '\' |
Windows don't see the difference between them.
Only ever use backslash as directory separator when dealing with user input.
Regarding custom filter, it depends on the way you implemented it. Testcase, please. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sat Dec 19, 2015 10:46 pm Post subject: |
|
|
Can you provide some real examples. I could not find any problems with
setPluginsDir() with a real path.
Smarty does accept both separators '/' and '\'.
In which context did you use $this->registerFilter() which was failing? |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Mon Dec 21, 2015 3:49 pm Post subject: |
|
|
I think I found it. I think you used something like
Code: | $smarty->setPluginsDir('/realpath/....'); |
without drive letter, which should normalize to the root dir of the current working drive.
This fix is now in the master branch on github.
Meanwhile I had released 3.1.29 so it will be in 3.1.30 |
|
Back to top |
|
dleffler Smarty Rookie
Joined: 20 Sep 2011 Posts: 8
|
Posted: Tue Dec 22, 2015 11:35 am Post subject: |
|
|
Problem still exists in 3.1.29, the Smarty->_realpath() method still only checks for a '/' slash in line #1181, therefore it adds the cwd to the 'full' path it was passed since the passed $path was converted to '\' backslashes in line #1178. |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Tue Dec 22, 2015 1:20 pm Post subject: |
|
|
dleffler wrote: | Problem still exists in 3.1.29 |
U.Tews wrote: | This fix is now in the master branch on github.
Meanwhile I had released 3.1.29 so it will be in 3.1.30 |
WTS Reading Comprehension skillbook. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|