Index: includes/path.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/path.inc,v
retrieving revision 1.24
diff -u -p -r1.24 path.inc
--- includes/path.inc	24 Jun 2008 22:12:15 -0000	1.24
+++ includes/path.inc	26 Sep 2008 11:29:53 -0000
@@ -14,7 +14,7 @@
  * Initialize the $_GET['q'] variable to the proper normal path.
  */
 function drupal_init_path() {
-  if (!empty($_GET['q'])) {
+  if (isset($_GET['q'])) {
     $_GET['q'] = drupal_get_normal_path(trim($_GET['q'], '/'));
   }
   else {
@@ -107,7 +107,7 @@ function drupal_lookup_path($action, $pa
  */
 function drupal_get_path_alias($path, $path_language = '') {
   $result = $path;
-  if ($alias = drupal_lookup_path('alias', $path, $path_language)) {
+  if (($alias = drupal_lookup_path('alias', $path, $path_language)) !== FALSE) {
     $result = $alias;
   }
   return $result;
Index: modules/path/path.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/path/path.module,v
retrieving revision 1.145
diff -u -p -r1.145 path.module
--- modules/path/path.module	17 Sep 2008 20:37:32 -0000	1.145
+++ modules/path/path.module	26 Sep 2008 11:29:56 -0000
@@ -81,10 +81,16 @@ function path_admin_delete($pid = 0) {
 function path_set_alias($path = NULL, $alias = NULL, $pid = NULL, $language = '') {
   $path = urldecode($path);
   $alias = urldecode($alias);
+
+  // An empty string can't be an alias.
+  if ($alias === '') {
+    $alias = NULL;
+  }
+
   // First we check if we deal with an existing alias and delete or modify it based on pid.
   if ($pid) {
     // An existing alias.
-    if (!$path || !$alias) {
+    if (!isset($path) || !isset($alias)) {
       // Delete the alias based on pid.
       db_query('DELETE FROM {url_alias} WHERE pid = %d', $pid);
     }
@@ -93,7 +99,7 @@ function path_set_alias($path = NULL, $a
       db_query("UPDATE {url_alias} SET src = '%s', dst = '%s', language = '%s' WHERE pid = %d", $path, $alias, $language, $pid);
     }
   }
-  else if ($path && $alias) {
+  else if (isset($path) && isset($alias)) {
     // Check for existing aliases.
     if ($alias == drupal_get_path_alias($path, $language)) {
       // There is already such an alias, neutral or in this language.
@@ -107,7 +113,7 @@ function path_set_alias($path = NULL, $a
   }
   else {
     // Delete the alias.
-    if ($alias) {
+    if (isset($alias)) {
       db_query("DELETE FROM {url_alias} WHERE dst = '%s'", $alias);
     }
     else {
@@ -178,7 +184,7 @@ function path_form_alter(&$form, $form_s
       '#type' => 'fieldset',
       '#title' => t('URL path settings'),
       '#collapsible' => TRUE,
-      '#collapsed' => empty($path),
+      '#collapsed' => !isset($path),
       '#access' => user_access('create url aliases'),
       '#weight' => 30,
     );
@@ -190,7 +196,7 @@ function path_form_alter(&$form, $form_s
       '#collapsed' => TRUE,
       '#description' => t('Optionally specify an alternative URL by which this node can be accessed. For example, type "about" when writing an about page. Use a relative path and don\'t add a trailing slash or the URL alias won\'t work.'),
     );
-    if ($path) {
+    if (isset($path)) {
       $form['path']['pid'] = array(
         '#type' => 'value',
         '#value' => db_result(db_query("SELECT pid FROM {url_alias} WHERE dst = '%s' AND language = '%s'", $path, $form['#node']->language))
