Cleanup / resolved todos
authorAlexander Ebert <ebert@woltlab.com>
Tue, 11 Oct 2016 17:53:54 +0000 (19:53 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 11 Oct 2016 17:54:00 +0000 (19:54 +0200)
com.woltlab.wcf/option.xml
com.woltlab.wcf/templates/pageHeader.tpl
wcfsetup/install/files/acp/update_com.woltlab.wcf_3.0.0.php
wcfsetup/install/files/js/WCF.js
wcfsetup/install/files/js/WoltLabSuite/Core/Language.js
wcfsetup/install/files/lib/form/LoginForm.class.php
wcfsetup/install/files/lib/system/WCF.class.php
wcfsetup/install/files/lib/system/request/RouteHandler.class.php
wcfsetup/install/lang/de.xml

index 406c987625e690378651e351cd11a5617922d251..a64d841ffe66014e1c19f2d5bbf894e2f71dad0e 100644 (file)
                                <optiontype>textarea</optiontype>
                        </option>
                        
+                       <!-- legacy option, no longer used -->
                        <option name="url_legacy_mode">
                                <categoryname>hidden</categoryname>
                                <optiontype>boolean</optiontype>
                                <defaultvalue>0</defaultvalue>
                        </option>
+                       <!-- /legacy option, no longer used -->
+                       
                        <option name="url_omit_index_php">
                                <categoryname>general.page.seo</categoryname>
                                <optiontype>boolean</optiontype>
index 1516b16d91029b0d8666ce0c2c829db287dcd108..b87fa4880cb8df1fef0283b769606a9deeb5a33f 100644 (file)
@@ -16,7 +16,6 @@
                        </div>
                </div>
                
-               {* TODO: this should be moved somewhere else and turned into an option *}
                <script data-relocate="true">
                        require(['WoltLabSuite/Core/Ui/Page/Header/Fixed'], function(UiPageHeaderFixed) {
                                UiPageHeaderFixed.init();
index 16cc81df2f50edf9e4616ff406057b7350f0244d..e095d242193c2466bdb24782063c79d16e1aa281 100644 (file)
@@ -8,3 +8,5 @@
 // see: https://github.com/WoltLab/WCF/commit/e1b6d09d705d6c153612bb36c70efbdb3d42871e
 // 4. Generate signature_secret
 // see: https://github.com/WoltLab/WCF/commit/9fe8b50cc6011628e2ac72d6e80c9561312503f4
+// 5. add application configs
+// if (!file_exists($appConfig)) { Package::writeConfigFile($appPackageID); }
index a43170be3af4dad912198df9c8127455c22f8359..da301d810b0f0ca8ac7cf9a0f20c99af71ad3c22 100755 (executable)
@@ -788,10 +788,6 @@ $.extend(WCF, {
         * @return      string
         */
        convertLegacyURL: function(url) {
-               if (URL_LEGACY_MODE) {
-                       return url;
-               }
-               
                return url.replace(/^index\.php\/(.*?)\/\?/, function(match, controller) {
                        var $parts = controller.split(/([A-Z][a-z0-9]+)/);
                        var $controller = '';
index 1030de398955556b1b851e528604af66c52940ea..915221a33b762e51ea9ca80dcee8bc61b27b5bd3 100644 (file)
@@ -49,9 +49,6 @@ define(['Dictionary', './Template'], function(Dictionary, Template) {
                        var value = _languageItems.get(key);
                        
                        if (value === undefined) {
-                               // TODO
-                               //console.warn("Attempt to retrieve unknown phrase '" + key + "'.");
-                               //console.warn(new Error().stack);
                                return key;
                        }
                        
index 4a4224c8aee359eb062b1f6b8867882dee466ab0..92eafd8813b3794ed5e6ec3c04d1928de46a5d0b 100644 (file)
@@ -78,8 +78,6 @@ class LoginForm extends \wcf\acp\form\LoginForm {
                }
                
                // drop index.php
-               if (!URL_LEGACY_MODE) {
-                       $this->url = preg_replace('~index\.php~', '', $this->url);
-               }
+               $this->url = preg_replace('~index\.php~', '', $this->url);
        }
 }
index 6a1d27cb638a1b986d8d267e2eb8674f0dbeb099..42dba0e2e05d6cdfe3946c6a47f6bc94118773db 100644 (file)
@@ -454,8 +454,6 @@ class WCF {
                // register WCF as application
                self::$applications['wcf'] = ApplicationHandler::getInstance()->getApplicationByID(1);
                
-               // TODO: what exactly should the base href represent and how should it be calculated, also because
-               // defining it here eventually breaks the ACP due to tpl initialization occurs first
                if (!class_exists(WCFACP::class, false)) {
                        static::getTPL()->assign('baseHref', self::$applications['wcf']->getPageURL());
                }
@@ -529,8 +527,6 @@ class WCF {
                if (class_exists($className) && is_subclass_of($className, IApplication::class)) {
                        // include config file
                        $configPath = $packageDir . PackageInstallationDispatcher::CONFIG_FILE;
-                       
-                       // TODO: this should be done during update instead, remove this before any public release
                        if (!file_exists($configPath)) {
                                Package::writeConfigFile($package->packageID);
                        }
@@ -838,34 +834,7 @@ class WCF {
         * @return      string
         */
        public static function getRequestURI() {
-               if (URL_LEGACY_MODE) {
-                       // resolve path and query components
-                       $scriptName = $_SERVER['SCRIPT_NAME'];
-                       $pathInfo = RouteHandler::getPathInfo();
-                       if (empty($pathInfo)) {
-                               // bug fix if URL omits script name and path
-                               $scriptName = substr($scriptName, 0, strrpos($scriptName, '/'));
-                       }
-                       
-                       $path = str_replace('/index.php', '', str_replace($scriptName, '', $_SERVER['REQUEST_URI']));
-                       if (!StringUtil::isUTF8($path)) {
-                               $path = StringUtil::convertEncoding('ISO-8859-1', 'UTF-8', $path);
-                       }
-                       $path = FileUtil::removeLeadingSlash($path);
-                       $baseHref = self::getTPL()->get('baseHref');
-                       
-                       if (!empty($path) && mb_strpos($path, '?') !== 0) {
-                               $baseHref .= 'index.php/';
-                       }
-                       
-                       return $baseHref . $path;
-               }
-               else {
-                       $url = preg_replace('~^(https?://[^/]+)(?:/.*)?$~', '$1', self::getTPL()->get('baseHref'));
-                       $url .= $_SERVER['REQUEST_URI'];
-                       
-                       return $url;
-               }
+               return preg_replace('~^(https?://[^/]+)(?:/.*)?$~', '$1', self::getTPL()->get('baseHref')) . $_SERVER['REQUEST_URI'];
        }
        
        /**
index 548f3a379ff921712b38462f9133f28364e9242a..b15afff607e43e7ec24637a5748f6835258894a6 100644 (file)
@@ -296,50 +296,21 @@ class RouteHandler extends SingletonFactory {
                if (self::$pathInfo === null) {
                        self::$pathInfo = '';
                        
-                       if (!URL_LEGACY_MODE || RequestHandler::getInstance()->isACPRequest()) {
-                               // WCF 2.1: ?Foo/Bar/
-                               if (!empty($_SERVER['QUERY_STRING'])) {
-                                       // don't use parse_str as it replaces dots with underscores
-                                       $components = explode('&', $_SERVER['QUERY_STRING']);
-                                       for ($i = 0, $length = count($components); $i < $length; $i++) {
-                                               $component = $components[$i];
-                                               
-                                               $pos = mb_strpos($component, '=');
-                                               if ($pos !== false && $pos + 1 === mb_strlen($component)) {
-                                                       $component = mb_substr($component, 0, -1);
-                                                       $pos = false;
-                                               }
-                                               
-                                               if ($pos === false) {
-                                                       self::$pathInfo = urldecode($component);
-                                                       break;
-                                               }
+                       if (!empty($_SERVER['QUERY_STRING'])) {
+                               // don't use parse_str as it replaces dots with underscores
+                               $components = explode('&', $_SERVER['QUERY_STRING']);
+                               for ($i = 0, $length = count($components); $i < $length; $i++) {
+                                       $component = $components[$i];
+                                       
+                                       $pos = mb_strpos($component, '=');
+                                       if ($pos !== false && $pos + 1 === mb_strlen($component)) {
+                                               $component = mb_substr($component, 0, -1);
+                                               $pos = false;
                                        }
-                               }
-                       }
-                       
-                       // WCF 2.0: index.php/Foo/Bar/
-                       if ((URL_LEGACY_MODE && !RequestHandler::getInstance()->isACPRequest()) || (RequestHandler::getInstance()->isACPRequest() && empty(self::$pathInfo))) {
-                               if (isset($_SERVER['PATH_INFO'])) {
-                                       self::$pathInfo = $_SERVER['PATH_INFO'];
-                               }
-                               else if (isset($_SERVER['ORIG_PATH_INFO'])) {
-                                       self::$pathInfo = $_SERVER['ORIG_PATH_INFO'];
-                                               
-                                       // in some configurations ORIG_PATH_INFO contains the path to the file
-                                       // if the intended PATH_INFO component is empty
-                                       if (!empty(self::$pathInfo)) {
-                                               if (isset($_SERVER['SCRIPT_NAME']) && (self::$pathInfo == $_SERVER['SCRIPT_NAME'])) {
-                                                       self::$pathInfo = '';
-                                               }
-                                               
-                                               if (isset($_SERVER['PHP_SELF']) && (self::$pathInfo == $_SERVER['PHP_SELF'])) {
-                                                       self::$pathInfo = '';
-                                               }
-                                               
-                                               if (isset($_SERVER['SCRIPT_URL']) && (self::$pathInfo == $_SERVER['SCRIPT_URL'])) {
-                                                       self::$pathInfo = '';
-                                               }
+                                       
+                                       if ($pos === false) {
+                                               self::$pathInfo = urldecode($component);
+                                               break;
                                        }
                                }
                        }
index 42dfad2a1e5e64cafec36d2369cae0ca601683cc..dcaacea2352a45fd8291e0b8b1c4b656e98e5f83 100644 (file)
@@ -1144,12 +1144,6 @@ GmbH=Gesellschaft mit beschränkter Haftung]]></item>
                <item name="wcf.acp.option.show_update_notice_frontend"><![CDATA[Hinweis bei neuen Updates für Pakete im Frontend anzeigen]]></item>
                <item name="wcf.acp.option.url_omit_index_php"><![CDATA[Link-Umschreibungen aktivieren]]></item>
                <item name="wcf.acp.option.url_omit_index_php.description"><![CDATA[Wandelt Links in eine vereinfachte Form um, aus „http://example.com/index.php?thread/1-dies-ist-ein-test/“ wird „http://example.com/thread/1-dies-ist-ein-test/“ und vergleichbar. Achtung: Die Aktivierung der Link-Umschreibungen erfordert Rewrite-Unterstützung in {if LANGUAGE_USE_INFORMAL_VARIANT}deinem{else}Ihrem{/if} Webserver sowie eine entsprechende Konfiguration. Fehlerhafte Einstellungen können hier dazu führen, dass Links nicht mehr aufrufbar sind.<br>Eine Anleitung zur Einrichtung {if LANGUAGE_USE_INFORMAL_VARIANT}deines{else}Ihres{/if} Webservers {if LANGUAGE_USE_INFORMAL_VARIANT}findest du{else}finden Sie{/if} in diesem Artikel: <a href="{@$__wcf->getPath()}acp/dereferrer.php?url=https%3A%2F%2Fblog.woltlab.com%2Fentry%2F68-konfiguration-von-benutzerfreundlichen-urls-seo-urls%2F" class="externalURL">Konfiguration von benutzerfreundlichen URLs (SEO-URLs)</a>]]></item>
-               <item name="wcf.acp.option.url_legacy_mode"><![CDATA[Kompatibilitätsmodus für Links aktivieren]]></item>
-               <item name="wcf.acp.option.url_legacy_mode.description"><![CDATA[Die Aktivierung dieses Modus erzwingt die URL-Struktur von WoltLab Community Framework 2.0 und sollte nur aus Kompatibilitätsgründen zur Beibehaltung der Link-Gültigkeit aktiviert werden:
-<ul class="nativeList">
-       <li>WCF 2.0: „index.php/Thread/123-Title/“</li>
-       <li>WCF 2.1+: „index.php?thread/123-title/“</li>
-</ul>]]></item>
                <item name="wcf.acp.option.module_wcf_ad"><![CDATA[Werbung]]></item>
                <item name="wcf.acp.option.module_wcf_ad.description"><![CDATA[Aktiviert die <a href="{link controller='AdList'}{/link}">Verwaltung von Werbe-Anzeigen</a>.]]></item>
                <item name="wcf.acp.option.captcha_type"><![CDATA[Captcha-Art]]></item>