<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>
</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();
// 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); }
* @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 = '';
var value = _languageItems.get(key);
if (value === undefined) {
- // TODO
- //console.warn("Attempt to retrieve unknown phrase '" + key + "'.");
- //console.warn(new Error().stack);
return key;
}
}
// drop index.php
- if (!URL_LEGACY_MODE) {
- $this->url = preg_replace('~index\.php~', '', $this->url);
- }
+ $this->url = preg_replace('~index\.php~', '', $this->url);
}
}
// 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());
}
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);
}
* @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'];
}
/**
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;
}
}
}
<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>