diff --git a/core/includes/common.inc b/core/includes/common.inc
index 540f42b..89a059d 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -2369,12 +2369,17 @@ function l($text, $path, array $options = array()) {
$use_theme = FALSE;
}
}
- if ($use_theme) {
- return theme('link', array('text' => $text, 'path' => $path, 'options' => $options));
- }
+
// The result of url() is a plain-text URL. Because we are using it here
// in an HTML argument context, we need to encode it properly.
- return '' . ($options['html'] ? $text : check_plain($text)) . '';
+ $href = check_plain(url($path, $options));
+ $title = ($options['html'] ? $text : check_plain($text));
+ $attributes = new Attribute($options['attributes']);
+
+ if ($use_theme) {
+ return theme('link', array('title' => $title, 'href' => $href, 'attributes' => $attributes));
+ }
+ return '' . $title . '';
}
/**
diff --git a/core/includes/theme.inc b/core/includes/theme.inc
index d2fe902..79bc2bc 100644
--- a/core/includes/theme.inc
+++ b/core/includes/theme.inc
@@ -1632,13 +1632,13 @@ function theme_status_messages($variables) {
* or process functions or override this theme implementation.
*
* @param $variables
- * An associative array containing the keys 'text', 'path', and 'options'. See
- * the l() function for information about these variables.
+ * An associative array containing the keys 'title', 'href', and 'attributes'.
+ * See the l() function for information about these variables.
*
* @see l()
*/
function theme_link($variables) {
- return '' . ($variables['options']['html'] ? $variables['text'] : check_plain($variables['text'])) . '';
+ return '' . $variables['title'] . '';
}
/**
@@ -2967,7 +2967,7 @@ function drupal_common_theme() {
'variables' => array('display' => NULL),
),
'link' => array(
- 'variables' => array('text' => NULL, 'path' => NULL, 'options' => array()),
+ 'variables' => array('title' => NULL, 'href' => NULL, 'attributes' => array()),
),
'links' => array(
'variables' => array('links' => array(), 'attributes' => array('class' => array('links')), 'heading' => array()),