Index: includes/common.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/common.inc,v
retrieving revision 1.512
diff -u -r1.512 common.inc
--- includes/common.inc	29 Jan 2006 07:36:29 -0000	1.512
+++ includes/common.inc	1 Feb 2006 20:58:40 -0000
@@ -1012,7 +1012,9 @@
  *   an HTML string containing a link to the given path.
  */
 function l($text, $path, $attributes = array(), $query = NULL, $fragment = NULL, $absolute = FALSE, $html = FALSE) {
-  if ($path == $_GET['q']) {
+  // Make sure to compare the full path with parameters, but don't override $path or $query, they are sent to url() below
+  $query_check = ($query != '') ? '&' . $query : '';
+  if (($path . $query_check) == $_GET['q']) {
     if (isset($attributes['class'])) {
       $attributes['class'] .= ' active';
     }
