X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fsmilies.php;h=bbb7de2e2efac4f2ad8807789f522b28d12dc204;hb=41663c7592abe55a958632c3a48265e0a8544d2b;hp=289ad887f96bf5e5bfa87e92cbfdf0ded9e86264;hpb=4a473611163a12b48d3bbad71dc54765be8789f9;p=friendica.git diff --git a/mod/smilies.php b/mod/smilies.php index 289ad887f9..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); + System::jsonExit($results); } else { - return Smilies::replace('', true); + $s = '