Skip to content

Commit ba4fa98

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 ebafb07 + 53ab6f3 commit ba4fa98

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

DataCollector/DumpDataCollector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ public function __construct(Stopwatch $stopwatch = null, $fileLinkFormat = null,
4343
$fileLinkFormat = $fileLinkFormat ?: ini_get('xdebug.file_link_format') ?: get_cfg_var('xdebug.file_link_format');
4444
if ($fileLinkFormat && !is_array($fileLinkFormat)) {
4545
$i = max(strpos($fileLinkFormat, '%f'), strpos($fileLinkFormat, '%l'));
46-
$i = strpos($fileLinkFormat, '#', $i) ?: strlen($fileLinkFormat);
46+
$i = strpos($fileLinkFormat, '#"', $i) ?: strlen($fileLinkFormat);
4747
$fileLinkFormat = array(substr($fileLinkFormat, 0, $i), substr($fileLinkFormat, $i + 1));
48-
parse_str($fileLinkFormat[1], $fileLinkFormat[1]);
48+
$fileLinkFormat[1] = @json_decode('{'.$fileLinkFormat[1].'}', true) ?: array();
4949
}
5050
$this->stopwatch = $stopwatch;
5151
$this->fileLinkFormat = $fileLinkFormat;

0 commit comments

Comments
 (0)