From: Alexander Ebert Date: Sat, 14 Feb 2015 11:51:12 +0000 (+0100) Subject: Fixed some legacy paths and ACP issues X-Git-Tag: 2.1.0_RC_1~13 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e31cf6113a8a22a0b4b6cd1fb62513bc8528ba2a;p=GitHub%2FWoltLab%2FWCF.git Fixed some legacy paths and ACP issues --- diff --git a/wcfsetup/install/files/acp/js/WCF.ACP.js b/wcfsetup/install/files/acp/js/WCF.ACP.js index 1c43b33bcb..f3e8b2ba65 100644 --- a/wcfsetup/install/files/acp/js/WCF.ACP.js +++ b/wcfsetup/install/files/acp/js/WCF.ACP.js @@ -406,11 +406,21 @@ WCF.ACP.Package.Installation = Class.extend({ * Initializes the WCF.Action.Proxy object. */ _initProxy: function() { + var $actionName = ''; + var $parts = this._actionName.split(/([A-Z][a-z0-9]+)/); + for (var $i = 0, $length = $parts.length; $i < $length; $i++) { + var $part = $parts[$i]; + if ($part.length) { + if ($actionName.length) $actionName += '-'; + $actionName += $part.toLowerCase(); + } + } + this._proxy = new WCF.Action.Proxy({ failure: $.proxy(this._failure, this), showLoadingOverlay: false, success: $.proxy(this._success, this), - url: 'index.php/' + this._actionName + '/?t=' + SECURITY_TOKEN + SID_ARG_2ND + url: 'index.php?' + $actionName + '/?t=' + SECURITY_TOKEN + SID_ARG_2ND }); }, @@ -1788,7 +1798,7 @@ WCF.ACP.Worker = Class.extend({ }, showLoadingOverlay: false, success: $.proxy(this._success, this), - url: 'index.php/WorkerProxy/?t=' + SECURITY_TOKEN + SID_ARG_2ND + url: 'index.php?worker-proxy/?t=' + SECURITY_TOKEN + SID_ARG_2ND }); this._title = title; }, @@ -2437,7 +2447,7 @@ WCF.ACP.Import.Manager = Class.extend({ this._proxy = new WCF.Action.Proxy({ showLoadingOverlay: false, success: $.proxy(this._success, this), - url: 'index.php/WorkerProxy/?t=' + SECURITY_TOKEN + SID_ARG_2ND + url: 'index.php?worker-proxy/?t=' + SECURITY_TOKEN + SID_ARG_2ND }); this._redirectURL = redirectURL; @@ -2464,7 +2474,7 @@ WCF.ACP.Import.Manager = Class.extend({ success: $.proxy(function() { window.location = this._redirectURL; }, this), - url: 'index.php/CacheClear/?t=' + SECURITY_TOKEN + SID_ARG_2ND + url: 'index.php?cache-clear/?t=' + SECURITY_TOKEN + SID_ARG_2ND }); }, this)).appendTo($form); diff --git a/wcfsetup/install/files/lib/acp/action/InstallPackageAction.class.php b/wcfsetup/install/files/lib/acp/action/InstallPackageAction.class.php index 2b943c3bc1..3cd431d381 100755 --- a/wcfsetup/install/files/lib/acp/action/InstallPackageAction.class.php +++ b/wcfsetup/install/files/lib/acp/action/InstallPackageAction.class.php @@ -13,7 +13,7 @@ use wcf\util\StringUtil; * Handles an AJAX-based package installation. * * @author Alexander Ebert - * @copyright 2001-2014 WoltLab GmbH + * @copyright 2001-2015 WoltLab GmbH * @license GNU Lesser General Public License * @package com.woltlab.wcf * @subpackage acp.action @@ -119,7 +119,7 @@ class InstallPackageAction extends AbstractDialogAction { $application = $statement->fetchObject('wcf\data\application\Application'); // build redirect location - $location = $application->getPageURL() . 'acp/?PackageList/' . SID_ARG_2ND_NOT_ENCODED; + $location = $application->getPageURL() . 'acp/index.php?package-list/' . SID_ARG_2ND_NOT_ENCODED; WCF::resetZendOpcache(); diff --git a/wcfsetup/install/files/lib/acp/action/UninstallPackageAction.class.php b/wcfsetup/install/files/lib/acp/action/UninstallPackageAction.class.php index e0b4958e05..b0010a1b3d 100644 --- a/wcfsetup/install/files/lib/acp/action/UninstallPackageAction.class.php +++ b/wcfsetup/install/files/lib/acp/action/UninstallPackageAction.class.php @@ -136,7 +136,7 @@ class UninstallPackageAction extends InstallPackageAction { $application = $statement->fetchObject('wcf\data\application\Application'); // build redirect location - $location = $application->getPageURL() . 'acp/?PackageList/' . SID_ARG_2ND_NOT_ENCODED; + $location = $application->getPageURL() . 'acp/index.php?package-list/' . SID_ARG_2ND_NOT_ENCODED; // show success $this->data = array( diff --git a/wcfsetup/install/files/lib/system/request/RequestHandler.class.php b/wcfsetup/install/files/lib/system/request/RequestHandler.class.php index eb099df7e7..6681cfe506 100644 --- a/wcfsetup/install/files/lib/system/request/RequestHandler.class.php +++ b/wcfsetup/install/files/lib/system/request/RequestHandler.class.php @@ -197,7 +197,7 @@ class RequestHandler extends SingletonFactory { $controller = $routeData['controller']; // validate class name - if (!preg_match('~^[a-z0-9' . (URL_LEGACY_MODE ? '' : '\-') . ']+$~i', $controller)) { + if (!preg_match('~^[a-z0-9-]+$~i', $controller)) { throw new SystemException("Illegal class name '".$controller."'"); } @@ -216,6 +216,7 @@ class RequestHandler extends SingletonFactory { $this->activeRequest = new Request($classData['className'], $classData['controller'], $classData['pageType']); } catch (SystemException $e) { + die("eek: " . $e->getMessage()); throw new IllegalLinkException(); } } @@ -322,7 +323,7 @@ class RequestHandler extends SingletonFactory { protected function lookupController($controller, $pageType, $application) { if (isset($this->controllers[$application]) && isset($this->controllers[$application][$pageType])) { $ciController = mb_strtolower($controller); - if (!URL_LEGACY_MODE) $ciController = str_replace('-', '', $ciController); + if (!URL_LEGACY_MODE || $this->isACPRequest) $ciController = str_replace('-', '', $ciController); if (isset($this->controllers[$application][$pageType][$ciController])) { return $this->controllers[$application][$pageType][$ciController]; diff --git a/wcfsetup/install/files/lib/system/request/RouteHandler.class.php b/wcfsetup/install/files/lib/system/request/RouteHandler.class.php index 5ad3a35bb6..154aa8daa2 100644 --- a/wcfsetup/install/files/lib/system/request/RouteHandler.class.php +++ b/wcfsetup/install/files/lib/system/request/RouteHandler.class.php @@ -89,13 +89,10 @@ class RouteHandler extends SingletonFactory { * Adds default routes. */ protected function addDefaultRoutes() { + $acpRoute = new FlexibleRoute(true); + $this->addRoute($acpRoute); + if (URL_LEGACY_MODE) { - $acpRoute = new Route('ACP_default', true); - $acpRoute->setSchema('/{controller}/{id}'); - $acpRoute->setParameterOption('controller', 'Index', null, true); - $acpRoute->setParameterOption('id', null, '\d+', true); - $this->addRoute($acpRoute); - $defaultRoute = new Route('default'); $defaultRoute->setSchema('/{controller}/{id}'); $defaultRoute->setParameterOption('controller', null, null, true); @@ -103,9 +100,6 @@ class RouteHandler extends SingletonFactory { $this->addRoute($defaultRoute); } else { - $acpRoute = new FlexibleRoute(true); - $this->addRoute($acpRoute); - $defaultRoute = new FlexibleRoute(false); $this->addRoute($defaultRoute); }