Project

General

Profile

Actions

Bug #72407

closed

Extbase\DebuggerUtility::var_dump: blacklist does not work as expected

Added by Tim Riemenschneider almost 9 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2015-12-23
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

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...))


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #78511: DebuggerUtility changes global blacklistClosed2016-10-31

Actions
Actions #1

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

Actions #2

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

Actions #3

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

Actions #4

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

Actions #5

Updated by Wouter Wolters over 8 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #6

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF