@@ -600,9 +600,12 @@ function theme_image_formatter($variables) {
|
||||
$item = $variables['item'];
|
||||
$image = array(
|
||||
'path' => $item['uri'],
|
||||
'alt' => $item['alt'],
|
||||
);
|
||||
|
||||
if (array_key_exists('alt', $item)) {
|
||||
$image['alt'] = $item['alt'];
|
||||
}
|
||||
|
||||
if (isset($item['attributes'])) {
|
||||
$image['attributes'] = $item['attributes'];
|
||||
}
|
||||
@@ -613,7 +616,7 @@ function theme_image_formatter($variables) {
|
||||
}
|
||||
|
||||
// Do not output an empty 'title' attribute.
|
||||
if (drupal_strlen($item['title']) > 0) {
|
||||
if (isset($item['title']) && drupal_strlen($item['title']) > 0) {
|
||||
$image['title'] = $item['title'];
|
||||
}
|
||||
|
||||
@@ -625,9 +628,11 @@ function theme_image_formatter($variables) {
|
||||
$output = theme('image', $image);
|
||||
}
|
||||
|
||||
if (!empty($variables['path']['path'])) {
|
||||
// The link path and link options are both optional, but for the options to be
|
||||
// processed, the link path must at least be an empty string.
|
||||
if (isset($variables['path']['path'])) {
|
||||
$path = $variables['path']['path'];
|
||||
$options = $variables['path']['options'];
|
||||
$options = isset($variables['path']['options']) ? $variables['path']['options'] : array();
|
||||
// When displaying an image inside a link, the html option must be TRUE.
|
||||
$options['html'] = TRUE;
|
||||
$output = l($output, $path, $options);
|
||||
|
||||
Reference in New Issue
Block a user