-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Changed the name of the method to be more revelent. Fix the leading slash on the getWebLocation() for portability #558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
… displayed because of the rendered path with DIR. I tryed to make it as clean as possible
…lash of the WebLocation path.
I think I see what you're getting at, but this isn't quite right. The Perhaps 3 methods, something like |
yeah that sounds right to me. Sry for the mistake :) |
… (because it's needed when unlink()
@weaverryan something like that ? :) |
{ | ||
return null === $this->path ? null : $this->getUploadRootDir().'/'.$this->path; | ||
} | ||
|
||
public function getWebPath() | ||
{ | ||
return null === $this->path ? null : $this->getUploadDir().'/'.$this->path; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
calling it recursively will lead to an infinite loop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry but i don't see where there is a possible infinite loop :o. Maybe it was in the previous commit. I fixed it :p
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I loaded the page before the commit fixing it. Github does not refresh the page automatically when you add a commit to a pull request :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think that the getWebPath()
should return a path that starts with a slash or not?
uploads/documents/foo.pdf
versus
/uploads/documents/foo.pdf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stof thinks that is should not start with a leading slash for portability ( see comments here on my closed pull request #557 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no slash as you would have to remove it to use it in asset()
. A path starting with a slash in asset()
is not modified as it s assumed to be relative to the root of the domain. A path that don't start by a slash is assumed to be relative to the web folder (This concern the case where you don't configure the helper to use a CDN of course)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stof Yes sir, you're right - I've been omitting the leading slash without realizing it.
Changed the name of the method to be more revelent. Fix the leading slash on the getWebLocation() for portability
Merged - thanks for everyone's help! I did make a few small changes - there were two method references I noticed that we missed. If you spot anything else, let me know |
No description provided.