return \current($pluginStoreServer);
}
+ /**
+ * Restricts the available sources to official package
+ * servers when a secure download is requested.
+ */
+ final public static function enableSecureMode(): void
+ {
+ self::$secureMode = true;
+ }
+
/**
- * Returns true if the given server url is valid.
- *
- * @param string $serverURL
- * @return bool
+ * @deprecated 5.6 This method was only used in PackageUpdateServerAddForm.
*/
public static function isValidServerURL($serverURL)
{
{
$className = $application . '\\' . ($isAcpRequest ? 'acp\\' : '') . $pageType . '\\' . $controller . \ucfirst($pageType);
if (!\class_exists($className)) {
- // avoid CORS by allowing action classes invoked form every application domain
- if ($pageType === 'action' && $application !== 'wcf') {
- $className = 'wcf\\' . ($isAcpRequest ? 'acp\\' : '') . $pageType . '\\' . $controller . \ucfirst($pageType);
- if (!\class_exists($className)) {
- return null;
- }
- } else {
- return null;
- }
+ return null;
}
- // 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;
}