Fixed erroneous redirect on weird webservers
authorAlexander Ebert <ebert@woltlab.com>
Mon, 30 Mar 2015 13:55:04 +0000 (15:55 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 30 Mar 2015 13:55:04 +0000 (15:55 +0200)
wcfsetup/install/files/lib/page/AbstractPage.class.php

index 2e66ce275fa7d181858bc8c7dc99cf783916cdd5..ff22acb50c934231384b744bacc020c35c51ce08 100644 (file)
@@ -193,6 +193,11 @@ abstract class AbstractPage implements IPage, ITrackablePage {
                                $requestURI = StringUtil::convertEncoding('ISO-8859-1', 'UTF-8', $requestURI);
                        }
                        
+                       // some webservers output lower-case encoding (e.g. %c3 instead of %C3)
+                       $requestURI = preg_replace_callback('~%(?P<encoded>[a-zA-Z0-9]{2})~', function($matches) {
+                               return '%' . strtoupper($matches['encoded']);
+                       }, $requestURI);
+                       
                        $requestURL = parse_url($requestURI);
                        
                        $redirect = false;