diff --git a/core/includes/path.inc b/core/includes/path.inc index 630b34c..d442adb 100644 --- a/core/includes/path.inc +++ b/core/includes/path.inc @@ -13,12 +13,10 @@ * Initialize the $_GET['q'] variable to the proper normal path. */ function drupal_path_initialize() { - if (!empty($_GET['q'])) { - $_GET['q'] = drupal_get_normal_path($_GET['q']); - } - else { - $_GET['q'] = drupal_get_normal_path(variable_get('site_frontpage', 'node')); - } + if (empty($_GET['q'])) { + $_GET['q'] = variable_get('site_frontpage', 'node'); + } + $_GET['q'] = drupal_get_normal_path($_GET['q']); } /** diff --git a/core/modules/simpletest/tests/path.test b/core/modules/simpletest/tests/path.test index e1e2890..f9b629e 100644 --- a/core/modules/simpletest/tests/path.test +++ b/core/modules/simpletest/tests/path.test @@ -205,7 +205,7 @@ class UrlAlterFunctionalTest extends DrupalWebTestCase { */ function testGetQInitialized() { $this->drupalGet(''); - $this->assertRaw('$_GET[\'q\'] is set: 1', '$_GET[\'q\'] is properly initialized.'); + $this->assertRaw('$_GET[\'q\'] is empty: 0', '$_GET[\'q\'] is properly initialized.'); } /** diff --git a/core/modules/simpletest/tests/url_alter_test.module b/core/modules/simpletest/tests/url_alter_test.module index 620b64e..7182785 100644 --- a/core/modules/simpletest/tests/url_alter_test.module +++ b/core/modules/simpletest/tests/url_alter_test.module @@ -30,9 +30,9 @@ function url_alter_test_foo() { * Implements hook_url_inbound_alter(). */ function url_alter_test_url_inbound_alter(&$path, $original_path, $path_language) { - // Indicate whether $_GET['q'] is set. - if (!$path) { - print '$_GET[\'q\'] is set: ' . intval(isset($_GET['q'])); + if (!request_path()) { + print '$_GET[\'q\'] is empty: ' . intval(empty($_GET['q'])); + exit; } // Rewrite user/username to user/uid.