dagolden / Path-Tiny

File path utility
41 stars 59 forks source link

Should not expand tildes in 'relative' method #203

Closed regina-verbae closed 1 year ago

regina-verbae commented 6 years ago

Consider the following example:

path('/prefix/path/~username')->relative('/prefix/path')

The result should be ~username, but because it is passed to the constructor, which expands tildes, the result becomes /home/username.

This issue relates to #190, in that even the desired result of ~username is perhaps unsafe in that it could still end up converted to /home/username. So perhaps the safer answer would be ./~username as proposed in #190.

xdg commented 1 year ago

Fixed in fe8583b