From 3261ca2d240e05f89594b67ecfda7aa0d23ef566 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 13 May 2022 12:06:03 +0200 Subject: [PATCH] Add support for PHP 8.2's native SensitiveParameter attribute --- wcfsetup/install.php | 5 ++++- wcfsetup/install/files/lib/core.functions.php | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install.php b/wcfsetup/install.php index 2a70e62738..6df6a5eb94 100644 --- a/wcfsetup/install.php +++ b/wcfsetup/install.php @@ -50,7 +50,10 @@ function sanitizeStacktrace(\Throwable $e, bool $ignorePaths = false) { $isSensitive = false; if ( \method_exists($parameter, 'getAttributes') - && !empty($parameter->getAttributes(\wcf\SensitiveArgument::class)) + && ( + !empty($parameter->getAttributes(\wcf\SensitiveArgument::class)) + || !empty($parameter->getAttributes(\SensitiveParameter::class)) + ) ) { $isSensitive = true; } diff --git a/wcfsetup/install/files/lib/core.functions.php b/wcfsetup/install/files/lib/core.functions.php index 1338a093c6..0286c4a2b7 100644 --- a/wcfsetup/install/files/lib/core.functions.php +++ b/wcfsetup/install/files/lib/core.functions.php @@ -723,7 +723,10 @@ EXPLANATION; $isSensitive = false; if ( \method_exists($parameter, 'getAttributes') - && !empty($parameter->getAttributes(\wcf\SensitiveArgument::class)) + && ( + !empty($parameter->getAttributes(\wcf\SensitiveArgument::class)) + || !empty($parameter->getAttributes(\SensitiveParameter::class)) + ) ) { $isSensitive = true; } -- 2.20.1