When a Photo field contains a Flickr set URL a non-breaking warning is displayed:

warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/martin/www/drupal-6/includes/bootstrap.inc on line 860.

Comments

lolandese’s picture

Status: Active » Needs review
StatusFileSize
new7.2 KB

In flickr.inc in the function flickr_img() contains:

return theme('image', $img_url, $title, $title, $attributes, FALSE);

where an in case of photos from a set an array was passed to $title, leading to the warning and also to an image title and alt attribute not been set.

A leading code snippet assures the right array index is used:

  // Make sure we are not passing an array where a string is expected.
  $title = is_array($photo['title']) ? str_replace('"', "'", htmlspecialchars_decode(strip_tags($photo['title']['_content']))) : $photo['title'];
  }

Meanwhile corrected some Code Sniffer code style suggestions.

lolandese’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.