social: fix, break instead of reverse

This commit is contained in:
onli 2016-09-07 23:24:55 +02:00
parent 673d61f5e8
commit 39894418eb

View file

@ -166,9 +166,10 @@ class serendipity_event_social extends serendipity_event {
// This is searching for the first image in an entry to use as facebook article image.
// A better approach would be to register in the entry editor when an image was added
if (preg_match_all('@<img.*src=["\'](.+)["\']@imsU', $entry['body'] . $entry['extended'], $images)) {
foreach (array_reverse($images[1]) as $im) {
foreach ($images[1] as $im) {
if (strpos($im, '/emoticons/') === false) {
$social_image = $im;
break;
}
}
}