Skip to content

Commit 5d98d75

Browse files
bug #19950 [FrameworkBundle] Parse source link maps using json_decode() instead of parse_str() (nicolas-grekas)
This PR was merged into the 3.2-dev branch. Discussion ---------- [FrameworkBundle] Parse source link maps using json_decode() instead of parse_str() | Q | A | ------------- | --- | Branch? | master | Bug fix? | yes | New feature? | no | BC breaks? | updated code exists only on master | Deprecations? | no | Tests pass? | yes | Fixed tickets | #19807 | License | MIT | Doc PR | symfony/symfony-docs#6944 Because `parse_str()` turns some characters into underscores in keys (e.g. `.`). Commits ------- 9b174fb [FrameworkBundle] Parse source link maps using json_decode() instead of parse_str()
2 parents a9c94a8 + eb7dd12 commit 5d98d75

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Templating/Helper/CodeHelper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ public function __construct($fileLinkFormat, $rootDir, $charset)
3636
$fileLinkFormat = $fileLinkFormat ?: ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
3737
if ($fileLinkFormat && !is_array($fileLinkFormat)) {
3838
$i = max(strpos($fileLinkFormat, '%f'), strpos($fileLinkFormat, '%l'));
39-
$i = strpos($fileLinkFormat, '#', $i) ?: strlen($fileLinkFormat);
39+
$i = strpos($fileLinkFormat, '#"', $i) ?: strlen($fileLinkFormat);
4040
$fileLinkFormat = array(substr($fileLinkFormat, 0, $i), substr($fileLinkFormat, $i + 1));
41-
parse_str($fileLinkFormat[1], $fileLinkFormat[1]);
41+
$fileLinkFormat[1] = @json_decode('{'.$fileLinkFormat[1].'}', true) ?: array();
4242
}
4343
$this->fileLinkFormat = $fileLinkFormat;
4444
$this->rootDir = str_replace('\\', '/', $rootDir).'/';

0 commit comments

Comments
 (0)