summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2006-04-27 08:44:45 +0000
committerDries Buytaert <dries@buytaert.net>2006-04-27 08:44:45 +0000
commitbd08cb5e9cf1d3ac2e10c88d0b48cad033856e50 (patch)
tree620abd82665da4fbcf1cf48ddffb4cc2c018ce09
parentadb88830d85f70fad79d0868b9ba9e537b00dc4a (diff)
downloadbrdo-bd08cb5e9cf1d3ac2e10c88d0b48cad033856e50.tar.gz
brdo-bd08cb5e9cf1d3ac2e10c88d0b48cad033856e50.tar.bz2
- Patch #59222 by Zen: make the front page check reliable.
-rw-r--r--includes/common.inc7
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) {