Bug #72407
closedExtbase\DebuggerUtility::var_dump: blacklist does not work as expected
100%
Description
When trying to blacklist classes/properties from the output, the first argument is ignored. This stems from the fact, that strpos is used in Extbase\DebuggerUtility::isBlacklisted
.
I.e. when dumping a class:
class DumpMe { /** @var string */ protected $secretData = 'do not show me'; /** @var string */ protected $showMe = 'show me in debug'; }
with DebuggerUtility::var_dump($myObj, 'Debug Test', 8, FALSE, TRUE, FALSE, null, array('secretData'));
the secretData is still shown.
isBlacklisted
contains:$result = (strpos(implode('|', self::$blacklistedPropertyNames), $value->getName()) > 0);
and since the string "secretData" is at position 0 in the imploded array, it is still shown.
dumping with DebuggerUtility::var_dump($myObj, 'Debug Test', 8, FALSE, TRUE, FALSE, null, array('dummy', 'secretData'));
or even with DebuggerUtility::var_dump($myObj, 'Debug Test', 8, FALSE, TRUE, FALSE, null, array('prefixDoesNotMattersecretData'));
, it is hidden.
when using strpos, the return value should be checked with "!== FALSE
".
However, why is strpos even used here? why not $result = in_array($value->getName(), self::$blacklistedPropertyNames);
(maybe guarded by if(is_array...)
)
Updated by Gerrit Code Review over 8 years ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49229
Updated by Gerrit Code Review over 8 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49229
Updated by Gerrit Code Review over 8 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49229
Updated by Gerrit Code Review over 8 years ago
Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49258
Updated by Wouter Wolters over 8 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset f6bd3db8b005a501601ff3479b061db9006a6094.