X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fsmilies.php;h=bbb7de2e2efac4f2ad8807789f522b28d12dc204;hb=41663c7592abe55a958632c3a48265e0a8544d2b;hp=04bdbe88ee331c1732451849ce6561b83142a7d5;hpb=be1333280765549860f9a7dc778a89acbd21dea6;p=friendica.git diff --git a/mod/smilies.php b/mod/smilies.php index 04bdbe88ee..bbb7de2e2e 100644 --- a/mod/smilies.php +++ b/mod/smilies.php @@ -1,21 +1,32 @@ argv[1] === "json") { - $tmp = Smilies::get_list(); - $results = array(); - for ($i = 0; $i < count($tmp['texts']); $i++) { - $results[] = array('text' => $tmp['texts'][$i], 'icon' => $tmp['icons'][$i]); + $smilies = Smilies::getList(); + if (!empty($a->argv[1]) && ($a->argv[1] === "json")) { + $results = []; + for ($i = 0; $i < count($smilies['texts']); $i++) { + $results[] = ['text' => $smilies['texts'][$i], 'icon' => $smilies['icons'][$i]]; } - json_return_and_die($results); + System::jsonExit($results); } else { - return Smilies::replace('', true); + $s = '