### Eclipse Workspace Patch 1.0 #P drupal-contrib-6--1 Index: modules/globalredirect/globalredirect.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/globalredirect/globalredirect.module,v retrieving revision 1.1.2.4.2.5.2.2 diff -u -r1.1.2.4.2.5.2.2 globalredirect.module --- modules/globalredirect/globalredirect.module 29 Dec 2007 16:33:42 -0000 1.1.2.4.2.5.2.2 +++ modules/globalredirect/globalredirect.module 30 Dec 2007 14:50:34 -0000 @@ -45,9 +45,19 @@ drupal_goto($request, $query_string, NULL, 301); } - //If no alias was returned, the final check is to direct non-clean to clean - if clean is enabled - if ((bool)variable_get('clean_url', 0) && strpos(request_uri(), '?q=')) { - drupal_goto($request, $query_string, NULL, 301); + // If no alias was returned, the final check is to direct non-clean to clean - if clean is enabled. + if ((bool)variable_get('clean_url', 0) && $_SERVER['REQUEST_METHOD'] == 'GET') { + // Make sure what Webserver is running or the script will end up in an endless redirect loop. + // To be save there is no support for this last redirection check on Webservers not listed here. + + // Apache mod_rewrite provide the clean_url in the variable REQUEST_URI. + if (strpos($_SERVER['SERVER_SOFTWARE'], 'Apache') && isset($_SERVER['REQUEST_URI']) && strpos($_SERVER['REQUEST_URI'], '?q=')) { + drupal_goto($request, $query_string, NULL, 301); + } + // ISAPI_Rewrite 3.x Filter will provide the clean_url in the variable HTTP_X_REWRITE_URL on IIS. + elseif (strpos($_SERVER['SERVER_SOFTWARE'], 'IIS') && isset($_SERVER['HTTP_X_REWRITE_URL']) && strpos($_SERVER['HTTP_X_REWRITE_URL'], '?q=')) { + drupal_goto($request, $query_string, NULL, 301); + } } } }