diff -up d6/globalredirect/globalredirect.info d7/globalredirect/globalredirect.info --- d6/globalredirect/globalredirect.info 2009-11-01 11:43:35.000000000 +0530 +++ d7/globalredirect/globalredirect.info 2009-11-01 11:41:57.000000000 +0530 @@ -2,7 +2,10 @@ name = "Global Redirect" description = "Searches for an alias of the current URL and 301 redirects if found. Stops duplicate content arising when path module is enabled." dependencies[] = path -core = 6.x +core = 7.x +files[] = globalredirect.module +files[] = globalredirect.install +files[] = globalredirect.admin.inc ; Information added by drupal.org packaging script on 2009-09-13 version = "6.x-1.x-dev" core = "6.x" diff -up d6/globalredirect/globalredirect.module d7/globalredirect/globalredirect.module --- d6/globalredirect/globalredirect.module 2008-12-22 16:04:32.000000000 +0530 +++ d7/globalredirect/globalredirect.module 2009-11-01 11:40:42.000000000 +0530 @@ -82,7 +82,7 @@ function globalredirect_init() { } // Get the Query String (minus the 'q'). If none set, set to NULL - $query_string = drupal_query_string_encode($_GET, array('q')); + $query_string = drupal_http_build_query(drupal_get_query_parameters()); if (empty($query_string)) { $query_string = NULL; } @@ -135,7 +135,10 @@ function globalredirect_init() { // Alias case sensitivity check. If there is an alias from the previous lookup, do a query to test for case. if ($alias && variable_get('globalredirect_case_sensitive_urls', GLOBALREDIRECT_CASE_SENSITIVE_URLS_ENABLED) == GLOBALREDIRECT_CASE_SENSITIVE_URLS_ENABLED) { - $alias_sensitive = db_result(db_query("SELECT dst FROM {url_alias} WHERE dst = '%s'", $alias)); + $select = db_select('url_alias'); + $select->addField('url_alias', 'alias'); + $select->condition('alias', $alias); + $alias_sensitive = $select->execute()->fetchField(); if ($alias_sensitive && $alias != $alias_sensitive) { // There is a match and there is a difference in case. $alias = $alias_sensitive; @@ -146,13 +149,13 @@ function globalredirect_init() { if ($_REQUEST['q'] != $prefix . $alias) { // If it's not just a slash or user has deslash on, redirect if (str_replace($prefix . $alias, '', $_REQUEST['q']) != '/' || $redirect_slash) { - drupal_goto($alias, $query_string, NULL, 301); + drupal_goto($alias, array('query' => $query_string), 301); } } // If no alias was returned, the final check is to direct non-clean to clean - if clean is enabled if ((variable_get('globalredirect_nonclean2clean', GLOBALREDIRECT_NONCLEAN2CLEAN_ENABLED) == GLOBALREDIRECT_NONCLEAN2CLEAN_ENABLED) && ((bool)variable_get('clean_url', 0)) && strpos(request_uri(), '?q=')) { - drupal_goto($request, $query_string, NULL, 301); + drupal_goto($request, array('query' => $query_string), 301); } // Restore the destination from earlier so its available in other places. @@ -167,7 +170,7 @@ function globalredirect_init() { function globalredirect_menu() { $items = array(); - $items['admin/settings/globalredirect'] = array( + $items['admin/config/system/globalredirect'] = array( 'title' => 'Global Redirect', 'description' => 'Chose which features you would like enabled for Global Redirect', 'access callback' => 'user_access', Common subdirectories: d6/globalredirect/translations and d7/globalredirect/translations