Commit bd08cb5e authored by Dries's avatar Dries

- Patch #59222 by Zen: make the front page check reliable.

parent adb88830
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment