@@ -1739,13 +1741,22 @@ * http://juicystudio.com/article/screen-readers-display-none.php and * http://www.w3.org/TR/WCAG-TECHS/H42.html for more information. */ -function theme_links($variables) { +function template_preprocess_links(&$variables) { $language_url = language(LANGUAGE_TYPE_URL); - $links = $variables['links']; - $attributes = $variables['attributes']; - $heading = $variables['heading']; - $output = ''; + $heading = &$variables['heading']; + + // Remove 'links' from the attributes array. This is added through + // template_preprocess() but we do not need it. + // @todo Remove after http://drupal.org/node/1938430 is resolved. + if (isset($variables['attributes']['class'][0]) && $variables['attributes']['class'][0] == 'links') { + unset($variables['attributes']['class'][0]); + if (empty($variables['attributes']['class'])) { + unset($variables['attributes']['class']); + } + } + $variables['attributes'] = new Attribute($variables['attributes']); if (!empty($links)) { // Prepend the heading to the list, if any.