diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-01-19 21:57:42 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-01-19 21:57:42 +0000 |
commit | 3714827685aa14ba51fdbcc431fa421b27abd314 (patch) | |
tree | 1e810692022f417355624459da87162f72f40c62 /includes/common.inc | |
parent | b5ac46848ec8177fed8a2d5effc1e3e30d7f33e3 (diff) | |
download | brdo-3714827685aa14ba51fdbcc431fa421b27abd314.tar.gz brdo-3714827685aa14ba51fdbcc431fa421b27abd314.tar.bz2 |
- Fixed bug 5247: active link marking invalidates HTML. Patch by Goba.
Diffstat (limited to 'includes/common.inc')
-rw-r--r-- | includes/common.inc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/includes/common.inc b/includes/common.inc index d2303bd31..2dab60263 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -1037,7 +1037,15 @@ function drupal_attributes($attributes = NULL) { } function l($text, $url, $attributes = array(), $query = NULL, $fragment = NULL) { - return "<a href=\"". url($url, $query, $fragment) ."\"". ($url == $_GET['q'] ? ' class="active"' : NULL) . drupal_attributes($attributes) .">$text</a>"; + if ($url == $_GET['q']) { + if (isset($attributes['class'])) { + $attributes['class'] .= ' active'; + } + else { + $attributes['class'] = 'active'; + } + } + return "<a href=\"". url($url, $query, $fragment) ."\"". drupal_attributes($attributes) .">$text</a>"; } function field_get($string, $name) { |