social: fix, break instead of reverse
This commit is contained in:
parent
673d61f5e8
commit
39894418eb
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue