Skip to content

Commit

Permalink
bug #13693 [HttpKernel] Fixed DumpDataCollector: dump.name for Window…
Browse files Browse the repository at this point in the history
…s file paths (King2500)

This PR was merged into the 2.6 branch.

Discussion
----------

[HttpKernel] Fixed DumpDataCollector: dump.name for Windows file paths

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes?
| Fixed tickets |
| License       | MIT
| Doc PR        |

When using VarDumper on Windows files, the automatic "dump.name" generated wrong names.
`dump()` call in:

```
F:\HtDocs\demo\src\Acme\Controller\DemoController.php
```

Displayed:
```
dump()
in :\HtDocs\demo\src\Acme\Controller\DemoController.php line 35
```
Expected result is:
```
dump()
in DemoController.php line 35
```

The existing code in line 118 didn't use the variable from the previous line.

Commits
-------

a025dea Fix dump.name for Windows file paths
  • Loading branch information
fabpot committed Feb 17, 2015
2 parents ce00962 + a025dea commit 42e6540
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -115,7 +115,7 @@ public function dump(Data $data)

if (false === $name) {
$name = strtr($file, '\\', '/');
$name = substr($file, strrpos($file, '/') + 1);
$name = substr($name, strrpos($name, '/') + 1);
}

$this->data[] = compact('data', 'name', 'file', 'line', 'fileExcerpt');
Expand Down

0 comments on commit 42e6540

Please sign in to comment.