mirror of
https://github.com/werkraum-media/fdebug.git
synced 2024-11-22 02:56:08 +01:00
Support debugging of File and FileReference
It already was supported, but tried to output the contents. We explicitly deny the `getContents()` method. Relates: #2
This commit is contained in:
parent
92c28ef25b
commit
50d9f617c1
1 changed files with 9 additions and 1 deletions
|
@ -643,11 +643,19 @@ class DebuggerUtility
|
||||||
protected static function exposeMethod(ReflectionMethod $method): bool
|
protected static function exposeMethod(ReflectionMethod $method): bool
|
||||||
{
|
{
|
||||||
$methodName = $method->getName();
|
$methodName = $method->getName();
|
||||||
|
$className = $method->getDeclaringClass()->getName();
|
||||||
$allowedPrefixes = ['get', 'has', 'is'];
|
$allowedPrefixes = ['get', 'has', 'is'];
|
||||||
|
$notAllowedCombinations = [
|
||||||
|
'TYPO3\CMS\Core\Resource\FileReference::getContents',
|
||||||
|
'TYPO3\CMS\Core\Resource\File::getContents',
|
||||||
|
];
|
||||||
|
|
||||||
$allowedByName = false;
|
$allowedByName = false;
|
||||||
foreach ($allowedPrefixes as $allowedPrefix) {
|
foreach ($allowedPrefixes as $allowedPrefix) {
|
||||||
if (StringUtility::beginsWith($methodName, $allowedPrefix)) {
|
if (
|
||||||
|
StringUtility::beginsWith($methodName, $allowedPrefix)
|
||||||
|
&& in_array($className . '::' . $methodName, $notAllowedCombinations) === false
|
||||||
|
) {
|
||||||
$allowedByName = true;
|
$allowedByName = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue