From: <var...@us...> - 2021-08-06 08:20:54
|
Revision: 10447 http://sourceforge.net/p/phpwiki/code/10447 Author: vargenau Date: 2021-08-06 08:20:47 +0000 (Fri, 06 Aug 2021) Log Message: ----------- Remove DISABLE_HTTP_REDIRECT Modified Paths: -------------- trunk/config/config-default.ini trunk/config/config-dist.ini trunk/configurator.php trunk/lib/IniConfig.php trunk/lib/Request.php Modified: trunk/config/config-default.ini =================================================================== --- trunk/config/config-default.ini 2021-08-06 08:01:30 UTC (rev 10446) +++ trunk/config/config-default.ini 2021-08-06 08:20:47 UTC (rev 10447) @@ -147,7 +147,6 @@ ; TEMP_DIR = /tmp ; ALLOWED_LOAD = /tmp -DISABLE_HTTP_REDIRECT = false DISABLE_GETIMAGESIZE = true ; FORTUNE_DIR = /usr/share/fortune ; GOOGLE_LICENSE_KEY = "..." Modified: trunk/config/config-dist.ini =================================================================== --- trunk/config/config-dist.ini 2021-08-06 08:01:30 UTC (rev 10446) +++ trunk/config/config-dist.ini 2021-08-06 08:20:47 UTC (rev 10447) @@ -1126,19 +1126,6 @@ ; Page name of RecentChanges page. Used for RSS Auto-discovery ;RECENT_CHANGES = RecentChange -; Disable HTTP redirects. -; (You probably don't need to touch this.) -; -; PhpWiki uses HTTP redirects for some of its functionality. -; (e.g. after saving changes, PhpWiki redirects your browser to -; view the page you just saved.) -; Some web service providers (notably free European Lycos) don't seem to -; allow these redirects. (On Lycos the result in an "Internal Server Error" -; report.) In that case you can set DISABLE_HTTP_REDIRECT to true. -; (In which case, PhpWiki will revert to sneakier tricks to try to -; redirect the browser...) -;DISABLE_HTTP_REDIRECT = true - ; If you get a crash at loading LinkIcons you might want to disable ; the getimagesize() function, which crashes on certain php versions and ; and some external images (png's, ..). Modified: trunk/configurator.php =================================================================== --- trunk/configurator.php 2021-08-06 08:01:30 UTC (rev 10446) +++ trunk/configurator.php 2021-08-06 08:20:47 UTC (rev 10447) @@ -1441,9 +1441,6 @@ new _define_optional('RECENT_CHANGES', "RecentChanges"); -$properties["Disable HTTP Redirects"] = - new boolean_define_commented_optional('DISABLE_HTTP_REDIRECT'); - $properties["Disable GETIMAGESIZE"] = new boolean_define_commented_optional('DISABLE_GETIMAGESIZE'); Modified: trunk/lib/IniConfig.php =================================================================== --- trunk/lib/IniConfig.php 2021-08-06 08:01:30 UTC (rev 10446) +++ trunk/lib/IniConfig.php 2021-08-06 08:20:47 UTC (rev 10447) @@ -200,7 +200,6 @@ 'AUTH_USER_FILE_STORABLE', 'ALLOW_HTTP_AUTH_LOGIN', 'ALLOW_USER_LOGIN', 'ALLOW_LDAP_LOGIN', 'ALLOW_IMAP_LOGIN', 'WARN_NONPUBLIC_INTERWIKIMAP', 'USE_PATH_INFO', - 'DISABLE_HTTP_REDIRECT', 'PLUGIN_CACHED_USECACHE', 'PLUGIN_CACHED_FORCE_SYNCMAP', 'BLOG_DEFAULT_EMPTY_PREFIX', 'DATABASE_PERSISTENT', 'FUSIONFORGE', Modified: trunk/lib/Request.php =================================================================== --- trunk/lib/Request.php 2021-08-06 08:01:30 UTC (rev 10446) +++ trunk/lib/Request.php 2021-08-06 08:20:47 UTC (rev 10447) @@ -169,36 +169,32 @@ } /* Redirects after edit may fail if no theme signature image is defined. - * Set DISABLE_HTTP_REDIRECT = true then. */ function redirect($url, $noreturn = true) { - $bogus = defined('DISABLE_HTTP_REDIRECT') && DISABLE_HTTP_REDIRECT; - if (!$bogus) { - header("Location: $url"); - /* - * "302 Found" is not really meant to be sent in response - * to a POST. Worse still, according to (both HTTP 1.0 - * and 1.1) spec, the user, if it is sent, the user agent - * is supposed to use the same method to fetch the - * redirected URI as the original. - * - * That means if we redirect from a POST, the user-agent - * supposed to generate another POST. Not what we want. - * (We do this after a page save after all.) - * - * Fortunately, most/all browsers don't do that. - * - * "303 See Other" is what we really want. But it only - * exists in HTTP/1.1 - * - * FIXME: this is still not spec compliant for HTTP - * version < 1.1. - */ - $status = $this->httpVersion() >= 1.1 ? 303 : 302; - $this->setStatus($status); - } + header("Location: $url"); + /* + * "302 Found" is not really meant to be sent in response + * to a POST. Worse still, according to (both HTTP 1.0 + * and 1.1) spec, the user, if it is sent, the user agent + * is supposed to use the same method to fetch the + * redirected URI as the original. + * + * That means if we redirect from a POST, the user-agent + * supposed to generate another POST. Not what we want. + * (We do this after a page save after all.) + * + * Fortunately, most/all browsers don't do that. + * + * "303 See Other" is what we really want. But it only + * exists in HTTP/1.1 + * + * FIXME: this is still not spec compliant for HTTP + * version < 1.1. + */ + $status = $this->httpVersion() >= 1.1 ? 303 : 302; + $this->setStatus($status); if ($noreturn) { $this->discardOutput(); // This might print the gzip headers. Not good. @@ -208,20 +204,6 @@ $tmpl = new Template('redirect', $this, array('REDIRECT_URL' => $url)); $tmpl->printXML(); $this->finish(); - } elseif ($bogus) { - // Safari needs window.location.href = targeturl - return JavaScript(" - function redirect(url) { - if (typeof location.replace == 'function') - location.replace(url); - else if (typeof location.assign == 'function') - location.assign(url); - else if (self.location.href) - self.location.href = url; - else - window.location = url; - } - redirect('" . addslashes($url) . "')"); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |