From 14c1c505e0b5915ff85f0698afc209f530fd83fb Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Sun, 1 Nov 2009 23:02:13 +0000 Subject: #607008 by dww, Gerhard Killesreiter, JacobSingh, and chx: Changed Fix bugs in https support and use https for authorize.php if available. --- includes/menu.inc | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'includes/menu.inc') diff --git a/includes/menu.inc b/includes/menu.inc index 7a6787c5f..558209355 100644 --- a/includes/menu.inc +++ b/includes/menu.inc @@ -2517,7 +2517,7 @@ function menu_link_save(&$item) { // This is the easiest way to handle the unique internal path '', // since a path marked as external does not need to match a router path. - $item['external'] = (menu_path_is_external($item['link_path']) || $item['link_path'] == '') ? 1 : 0; + $item['external'] = (url_is_external($item['link_path']) || $item['link_path'] == '') ? 1 : 0; // Load defaults. $item += array( 'menu_name' => 'navigation', @@ -3186,14 +3186,6 @@ function _menu_router_save($menu, $masks) { return $menu; } -/** - * Returns TRUE if a path is external (e.g. http://example.com). - */ -function menu_path_is_external($path) { - $colonpos = strpos($path, ':'); - return $colonpos !== FALSE && !preg_match('![/?#]!', substr($path, 0, $colonpos)) && filter_xss_bad_protocol($path, FALSE) == check_plain($path); -} - /** * Checks whether the site is in maintenance mode. * @@ -3254,7 +3246,7 @@ function menu_valid_path($form_item) { $path = $form_item['link_path']; // We indicate that a menu administrator is running the menu access check. $menu_admin = TRUE; - if ($path == '' || menu_path_is_external($path)) { + if ($path == '' || url_is_external($path)) { $item = array('access' => TRUE); } elseif (preg_match('/\/\%/', $path)) { -- cgit v1.2.3