diff options
Diffstat (limited to 'includes/common.inc')
-rw-r--r-- | includes/common.inc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/includes/common.inc b/includes/common.inc index 9a56dd759..ac500e2c3 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -204,11 +204,12 @@ function drupal_query_string_encode($query, $exclude = array(), $parent = '') { * @see drupal_goto() */ function drupal_get_destination() { - if ($_REQUEST['destination']) { + if (isset($_REQUEST['destination'])) { return 'destination='. urlencode($_REQUEST['destination']); } else { - $path = $_GET['q']; + // Use $_REQUEST here to retrieve the original path. + $path = isset($_REQUEST['q']) ? $_REQUEST['q'] : ''; $query = drupal_query_string_encode($_GET, array('q')); if ($query != '') { $path .= '?'. $query; @@ -994,7 +995,7 @@ function url($path = NULL, $query = NULL, $fragment = NULL, $absolute = FALSE) { $base = ($absolute ? $base_url . '/' : base_path()); // The special path '<front>' links to the default front page. - if (isset($path) && $path != '<front>') { + if (!empty($path) && $path != '<front>') { $path = drupal_get_path_alias($path); $path = drupal_urlencode($path); if (!$clean_url) { |