X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fsmilies.php;h=bbb7de2e2efac4f2ad8807789f522b28d12dc204;hb=41663c7592abe55a958632c3a48265e0a8544d2b;hp=4d8ab6bcaa55fcdb3dbd2d1929efc01a8296fd63;hpb=291906de5f3074407253241e5ccbb5af633e0c22;p=friendica.git diff --git a/mod/smilies.php b/mod/smilies.php index 4d8ab6bcaa..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]); +/** + * @param App $a App + * @return string + * @throws \Friendica\Network\HTTPException\InternalServerErrorException + */ +function smilies_content(App $a) +{ + $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); - } - else { - return Smilies::replace('',true); + System::jsonExit($results); + } else { + $s = '