@@ -42,10 +42,8 @@ public function __construct(Stopwatch $stopwatch = null, $fileLinkFormat = null,
42
42
{
43
43
$ fileLinkFormat = $ fileLinkFormat ?: ini_get ('xdebug.file_link_format ' ) ?: get_cfg_var ('xdebug.file_link_format ' );
44
44
if ($ fileLinkFormat && !is_array ($ fileLinkFormat )) {
45
- $ i = max (strpos ($ fileLinkFormat , '%f ' ), strpos ($ fileLinkFormat , '%l ' ));
46
- $ i = strpos ($ fileLinkFormat , '#" ' , $ i ) ?: strlen ($ fileLinkFormat );
47
- $ fileLinkFormat = array (substr ($ fileLinkFormat , 0 , $ i ), substr ($ fileLinkFormat , $ i + 1 ));
48
- $ fileLinkFormat [1 ] = @json_decode ('{ ' .$ fileLinkFormat [1 ].'} ' , true ) ?: array ();
45
+ $ i = strpos ($ f = $ fileLinkFormat , '& ' , max (strrpos ($ f , '%f ' ), strrpos ($ f , '%l ' ))) ?: strlen ($ f );
46
+ $ fileLinkFormat = array (substr ($ f , 0 , $ i )) + preg_split ('/&([^>]++)>/ ' , substr ($ f , $ i ), -1 , PREG_SPLIT_DELIM_CAPTURE );
49
47
}
50
48
$ this ->stopwatch = $ stopwatch ;
51
49
$ this ->fileLinkFormat = $ fileLinkFormat ;
@@ -268,9 +266,9 @@ private function doDump($data, $name, $file, $line)
268
266
$ name = strip_tags ($ this ->style ('' , $ name ));
269
267
$ file = strip_tags ($ this ->style ('' , $ file ));
270
268
if ($ fileLinkFormat ) {
271
- foreach ($ fileLinkFormat [1 ] as $ k => $ v ) {
272
- if (0 === strpos ($ file , $ k )) {
273
- $ file = substr_replace ($ file , $ v , 0 , strlen ($ k ));
269
+ for ($ i = 1 ; isset ( $ fileLinkFormat [$ i ]); ++ $ i ) {
270
+ if (0 === strpos ($ file , $ k = $ fileLinkFormat [ $ i ++] )) {
271
+ $ file = substr_replace ($ file , $ fileLinkFormat [ $ i ] , 0 , strlen ($ k ));
274
272
break ;
275
273
}
276
274
}
0 commit comments