Add support for PHP 8.2's native SensitiveParameter attribute
authorTim Düsterhus <duesterhus@woltlab.com>
Fri, 13 May 2022 10:06:03 +0000 (12:06 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Fri, 13 May 2022 10:09:09 +0000 (12:09 +0200)
wcfsetup/install.php
wcfsetup/install/files/lib/core.functions.php

index 2a70e6273842a2280523aefb74c0bdb59947782c..6df6a5eb940a427299efb56b648b6b046bc5f480 100644 (file)
@@ -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;
                                        }
index 1338a093c613eb01dee7b15757f2e4e651091b6f..0286c4a2b7244b2bfa9234933141b4288ec77ecb 100644 (file)
@@ -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;
                                                }