Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Upgrading to 3.1.28 woes

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
dleffler
Smarty Rookie


Joined: 20 Sep 2011
Posts: 8

PostPosted: Sat Dec 19, 2015 11:34 am    Post subject: Upgrading to 3.1.28 woes Reply with quote

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
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Sat Dec 19, 2015 3:37 pm    Post subject: Re: Upgrading to 3.1.28 woes Reply with quote

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
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sat Dec 19, 2015 10:46 pm    Post subject: Reply with quote

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
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Mon Dec 21, 2015 3:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
dleffler
Smarty Rookie


Joined: 20 Sep 2011
Posts: 8

PostPosted: Tue Dec 22, 2015 11:35 am    Post subject: Reply with quote

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
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Tue Dec 22, 2015 1:20 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP