Commit 2addc204 authored by Mario's avatar Mario Committed by Mario

we get an array of objects if there are multiple photos but array if there is...

we get an array of objects if there are multiple  photos but array if there is only one. typecast to array to be consistent.


(cherry picked from commit 1b14a2f3)
parent 67f7542b
......@@ -245,6 +245,9 @@ class Diaspora_Receiver {
if($photos) {
$tmp = '';
foreach($photos as $ph) {
// If there are multiple photos we get an array of objects here.
// Typecast them to array here to make sure we deal with an array in any case.
$ph = (array) $ph;
if((! $ph['remote_photo_path']) || (strpos($ph['remote_photo_path'],'http') !== 0))
continue;
$tmp .= '[img]' . $ph['remote_photo_path'] . $ph['remote_photo_name'] . '[/img]' . "\n\n";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment