Strengthen check for non-instantiable classes in ControllerMap::getClassData()
authorTim Düsterhus <duesterhus@woltlab.com>
Mon, 27 Jun 2022 14:56:56 +0000 (16:56 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Mon, 27 Jun 2022 14:56:56 +0000 (16:56 +0200)
wcfsetup/install/files/lib/system/request/ControllerMap.class.php

index ac0b7aa7710c5b393c7146aca07ab3c5566ae30f..de01cb4297d3610f83a409583cae20c04148d214 100644 (file)
@@ -444,9 +444,11 @@ class ControllerMap extends SingletonFactory
             }
         }
 
-        // check for abstract classes
+        // Verify that the class can be instantiated. This excludes
+        // abstract classes, interfaces, classes with a private constructor
+        // and more.
         $reflectionClass = new \ReflectionClass($className);
-        if ($reflectionClass->isAbstract()) {
+        if (!$reflectionClass->isInstantiable()) {
             return null;
         }