diff --git includes/common.inc includes/common.inc
index 1256f59..fafea11 100644
--- includes/common.inc
+++ includes/common.inc
@@ -2653,12 +2653,17 @@ function drupal_http_header_attributes(array $attributes = array()) {
  * @return
  *   An HTML string ready for insertion in a tag.
  */
-function drupal_attributes(array $attributes = array()) {
+function drupal_attributes(array $attributes = array(), $output = CHECK_PLAIN) {
   foreach ($attributes as $attribute => &$data) {
     if (is_array($data)) {
       $data = implode(' ', $data);
     }
-    $data = $attribute . '="' . check_plain($data) . '"';
+    if ($output == PASS_THROUGH) {
+      $data = $attribute . '="' . $data . '"';
+    }
+    else {
+      $data = $attribute . '="' . check_plain($data) . '"';
+    }
   }
   return $attributes ? ' ' . implode(' ', $attributes) : '';
 }
diff --git includes/theme.inc includes/theme.inc
index 8d3885e..d8dd6ef 100644
--- includes/theme.inc
+++ includes/theme.inc
@@ -1485,7 +1485,7 @@ function theme_links($variables) {
           && (empty($link['language']) || $link['language']->language == $language_url->language)) {
         $class[] = 'active';
       }
-      $output .= '<li' . drupal_attributes(array('class' => $class)) . '>';
+      $output .= '<li' . drupal_attributes(array('class' => $class), PASS_THROUGH) . '>';
 
       if (isset($link['href'])) {
         // Pass in $link as $options, they share the same keys.
diff --git modules/rdf/rdf.module modules/rdf/rdf.module
index 1c231f3..e977815 100644
--- modules/rdf/rdf.module
+++ modules/rdf/rdf.module
@@ -653,7 +653,7 @@ function rdf_field_attach_view_alter(&$output, $context) {
 function theme_rdf_template_variable_wrapper($variables) {
   $output = $variables['content'];
   if (!empty($output) && !empty($variables['attributes'])) {
-    $attributes = drupal_attributes($variables['attributes']);
+    $attributes = drupal_attributes($variables['attributes'], PASS_THROUGH);
     $output = $variables['inline'] ? "<span$attributes>$output</span>" : "<div$attributes>$output</div>";
   }
   return $output;
@@ -691,7 +691,7 @@ function theme_rdf_metadata($variables) {
     // XHTML+RDFa doctype allows either <span></span> or <span />, but for
     // maximum browser compatibility, W3C recommends the former when serving
     // pages using the text/html media type: http://www.w3.org/TR/xhtml1/#C_3.
-    $output .= '<span' . drupal_attributes($attributes) . '></span>';
+    $output .= '<span' . drupal_attributes($attributes, PASS_THROUGH) . '></span>';
   }
   return $output;
 }
