-
Notifications
You must be signed in to change notification settings - Fork 130
Bug on getUrl function with HomeFolder #161
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
Comments
Hi, maybe this can help you : #158 (comment) |
Hi, thank u for the answer, in my case it doest not solve my problem, i will probably just override the getURL function. The double "/" is not before the path, but between path and homefolder. I tryied ur solution, but not working. |
Hi @Solirio, what is your dev platform (win/linux/macos)? |
The problem appear on Windows and Linux Debian |
Hello, I have the same issue on Windows 7, not tested yet on Linux. |
In my case the bug also in extra slash between path and homeFolder in
Patching this function seems solves issue. |
Hello everyone, (Be ready for my english, im french, so sorry if it's bad)
After hours of research on a bug inside my app, i think i found it in ElfinderBundle.
My path
uploads/img/etablissements
My HomeFolder var can change all the time, but here is an exemple:
16/espace
So the complete url can be
uploads/img/etablissements/16/espace
It work well with everything exept the url of the Img. When i watch the src i see:
uploads/img/etablissements//16/espace/myimg.jpg
You can see a double / between my path and my homeFolder.
It make sometimes problem in TinyMce editor, img were sometimes like corrupted or not found in the editor. Most of the time it work. But i can't let bug like that even if it happen not often.
I found the problem in ElFinderConfigurationReader.
Inside the getConfiguration function. There is this code:
if ($homeFolder !== '') { $homeFolder = '/'.$homeFolder.'/'; }
this var is used two times:
For the path of the backend in the
$driverOptions
array:'path' => $path . $homeFolder
So path will be in my case
uploads/img/etablissements/16/espace
It's good
And for the URL of content in the
$driverOptions
too:'URL' => $this->getURL($parameter, $request, $homeFolder, $path)
The bug is inside getURL function:
sprintf('%s://%s%s/%s/%s', $request->getScheme(), $request->getHttpHost(), $request->getBasePath(), $path, $homeFolder)
U can see an other
/
is added between $path and $homeFolder.But one was already added in the getConfiguration function.
It's maybe normal, maybe i don't understand everything, all i know is this double slash made somes bug on my app.
Have Good Day guys :)
The text was updated successfully, but these errors were encountered: