Index: securepages.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/securepages/securepages.module,v retrieving revision 1.15.2.24 diff -u -p -r1.15.2.24 securepages.module --- securepages.module 3 Nov 2009 05:50:58 -0000 1.15.2.24 +++ securepages.module 20 Feb 2010 04:03:15 -0000 @@ -10,6 +10,10 @@ * Implementation of hook_boot(). */ function securepages_boot() { + // check for drush, if we do anything here we could break drush + if (function_exists('drush_main')) { + return NULL; + } $path = isset($_GET['q']) ? $_GET['q'] : ''; if ($path == 'admin/build/securepages/test') { if (securepages_is_secure()) { @@ -20,7 +24,7 @@ function securepages_boot() { } exit(); } - + if (!variable_get('securepages_enable', 0) || basename($_SERVER['PHP_SELF']) != 'index.php') { return; } @@ -46,7 +50,7 @@ function securepages_boot() { * Implementation of hook_init(). */ function securepages_init() { - if (!variable_get('securepages_enable', 0) || basename($_SERVER['PHP_SELF']) != 'index.php') { + if (!variable_get('securepages_enable', 0) || basename($_SERVER['PHP_SELF']) != 'index.php' || function_exists('drush_main')) { return; } @@ -172,7 +176,7 @@ function securepages_redirect() { */ function securepages_goto($secure) { global $base_root; - + $_SESSION['securepages_redirect'] = TRUE; $path = !empty($_REQUEST['q']) ? $_REQUEST['q'] : ''; $query = count($_GET) > 1 ? securepages_get_query($_GET) : NULL; @@ -189,7 +193,7 @@ function securepages_goto($secure) { bootstrap_invoke_all('exit'); } header('Location: '. $url); - + // Make sure the cache is clear so that the next page will not pick up a cached version. cache_clear_all($base_root . request_uri(), 'cache_page'); exit(); @@ -444,22 +448,22 @@ function securepages_urlencode($text) { */ function securepages_can_alter_url($url) { global $base_path, $base_url; - + @extract(@parse_url($url)); - + // If there is no scheme then it is a relative url and can be altered if (!isset($scheme) && $base_path == '/') { return TRUE; } - + // If the host names are not the same then don't allow altering of the path. if (isset($host) && strtolower($host) != strtolower($_SERVER['HTTP_HOST'])) { return FALSE; } - + if (strlen($base_path) > 1 && substr($base_url, -1) != substr($path, 1, strlen($base_path))) { return FALSE; } - + return TRUE; -} \ No newline at end of file +}