bug #15017 [VarDumper] Fix uninitialized id in HtmlDumper (nicolas-grekas)
This PR was merged into the 2.6 branch.
Discussion
----------
[VarDumper] Fix uninitialized id in HtmlDumper
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #15015
| License | MIT
| Doc PR | -
Commits
-------
00eee72
[VarDumper] Fix uninitialized id in HtmlDumper
This commit is contained in:
commit
aa971759d6
@ -46,6 +46,15 @@ class HtmlDumper extends CliDumper
|
|||||||
'index' => 'color:#1299DA',
|
'index' => 'color:#1299DA',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function __construct($output = null, $charset = null)
|
||||||
|
{
|
||||||
|
parent::__construct($output, $charset);
|
||||||
|
$this->dumpId = 'sf-dump-'.mt_rand();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
@ -94,8 +103,8 @@ class HtmlDumper extends CliDumper
|
|||||||
*/
|
*/
|
||||||
public function dump(Data $data, $output = null)
|
public function dump(Data $data, $output = null)
|
||||||
{
|
{
|
||||||
$this->dumpId = 'sf-dump-'.mt_rand();
|
|
||||||
parent::dump($data, $output);
|
parent::dump($data, $output);
|
||||||
|
$this->dumpId = 'sf-dump-'.mt_rand();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -342,7 +351,7 @@ EOHTML;
|
|||||||
$style .= sprintf(' title="%s%s characters"', $attr['length'], $attr['binary'] ? ' binary or non-UTF-8' : '');
|
$style .= sprintf(' title="%s%s characters"', $attr['length'], $attr['binary'] ? ' binary or non-UTF-8' : '');
|
||||||
} elseif ('note' === $style) {
|
} elseif ('note' === $style) {
|
||||||
if (false !== $c = strrpos($v, '\\')) {
|
if (false !== $c = strrpos($v, '\\')) {
|
||||||
return sprintf('<abbr title="%s" class=sf-dump-%s>%s</abbr>', $v, $style, substr($v, $c+1));
|
return sprintf('<abbr title="%s" class=sf-dump-%s>%s</abbr>', $v, $style, substr($v, $c + 1));
|
||||||
} elseif (':' === $v[0]) {
|
} elseif (':' === $v[0]) {
|
||||||
return sprintf('<abbr title="`%s` resource" class=sf-dump-%s>%s</abbr>', substr($v, 1), $style, $v);
|
return sprintf('<abbr title="`%s` resource" class=sf-dump-%s>%s</abbr>', substr($v, 1), $style, $v);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user