Merge pull request #49242 from nextcloud/backport/49237/stable30

This commit is contained in:
Kate 2024-11-13 10:46:27 +01:00 committed by GitHub
commit 05de3df5c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -101,12 +101,12 @@ class CORSMiddleware extends Middleware {
*/
protected function hasAnnotationOrAttribute(ReflectionMethod $reflectionMethod, string $annotationName, string $attributeClass): bool {
if ($this->reflector->hasAnnotation($annotationName)) {
$this->logger->debug($reflectionMethod->getDeclaringClass()->getName() . '::' . $reflectionMethod->getName() . ' uses the @' . $annotationName . ' annotation and should use the #[' . $attributeClass . '] attribute instead');
return true;
}
if (!empty($reflectionMethod->getAttributes($attributeClass))) {
$this->logger->debug($reflectionMethod->getDeclaringClass()->getName() . '::' . $reflectionMethod->getName() . ' uses the @' . $annotationName . ' annotation and should use the #[' . $attributeClass . '] attribute instead');
return true;
}