Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.841
diff -u -p -r1.841 common.inc
--- includes/common.inc	30 Dec 2008 16:43:14 -0000	1.841
+++ includes/common.inc	4 Jan 2009 15:33:44 -0000
@@ -1816,13 +1816,18 @@ function l($text, $path, array $options 
     }
   }
 
+  // allow '#' as a valid link href, otherwise check the url
+  if ($path !== '#') {
+    $path = check_url(url($path, $options));
+  }
+
   // Remove all HTML and PHP tags from a tooltip. For best performance, we act only
   // if a quick strpos() pre-check gave a suspicion (because strip_tags() is expensive).
   if (isset($options['attributes']['title']) && strpos($options['attributes']['title'], '<') !== FALSE) {
     $options['attributes']['title'] = strip_tags($options['attributes']['title']);
   }
 
-  return '<a href="' . check_url(url($path, $options)) . '"' . drupal_attributes($options['attributes']) . '>' . ($options['html'] ? $text : check_plain($text)) . '</a>';
+  return '<a href="' . $path . '"' . drupal_attributes($options['attributes']) . '>' . ($options['html'] ? $text : check_plain($text)) . '</a>';
 }
 
 /**
