-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[WebProfilerBundle] Render file links for twig templates (Fix #24355) #24356
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
This is an invalid fix:
The issue you have is that your own pattern expects extra escaping. This should be handled inside the |
I'm not sure why I'm getting javascript code and others dont. But I guess you are correct, best would be to fix it somewhere here |
This reverts commit 2aeed1f.
by checking if we run on Windows and $file contains a backslash char if we do, we apply PHPs addslashes function to $file
@pquerner you have this either in your FrameworkBundle config ( |
@@ -202,6 +202,10 @@ public function formatFile($file, $line, $text = null) | |||
*/ | |||
public function getFileLink($file, $line) | |||
{ | |||
//If on Windows, we must escape $file if it contains backslash char | |||
if('\\' === DIRECTORY_SEPARATOR && FALSE !== strpos($file, '\\')) { | |||
$file = addslashes($file); |
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.
As said before, this is a nogo as most cases don't want such escaping. You will probably break it for all other users.
True, |
btw, XDebug would suffer from the same issue, as it would not escape the path for usage inside a JS string either. But why do you need to use XHR to access the URL ? Why not using |
I dont need to use XHR, but I cannot get it without javascript. I disabled Xdebug, disabled the Xdebug config in PHP.ini (file_link_format), cleared cache and it still outputs the javascript stuff. I have no idea what I have done to my env. :/ In my cache files I could find this
But I dont know where that is generated. |
@pquerner have you restarted PHP-FPM (or Apache if you use mod_php) ? Otherwise, the php.ini change won't be taken into account (PHP-FPM loads the config when starting) |
and have you cleared the prod cache ? The CLI runs in the dev environment by default, not the prod one. But the code snupped you gave is from the prod environment |
The code is there in prod and dev environment. Yes, I have added |
Yes, I have restarted my apache server (I develop things locally via XAMPP, it has a control panel where you can start/stop the server easily) multiple times. Tried different browsers too, no luck. (Even tried |
Are you using this maybe? https://github.com/computerminds/parrot/blob/edfa1b99e629a090129908d34eee40ad7930765b/parrot-config/php/parrot-base.ini#L62 Anyway, im pretty convinced this happens on your side :) can you confirm xdebug config is correct, looking at |
Yes, I already found out it was the XDebug config. #24356 (comment) Ive been reconfiguring my local dev maschine to use a different XAMPP version and now it works like expected. Sorry for the big trouble, guys. I feel stupid :( |
PR #24236 introduced a bug for Windows machines and this PR attempts to fix it.
See related discussions in tickets #24355 and #24218 (and starting from comment #24236 (comment))
//Edit
I'm not sure why so many commits are attached here, this is the commit I wanted to PR:
pquerner@2aeed1f