X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fmsearch.php;h=0d7cca4ff1b9786f779cecef226b108929924ff6;hb=1c3bed1777ea51fabdf1ce91c1c34b7ed0c4b04c;hp=a652bc8ed87b92d86a646a3043b932b1f79ea65a;hpb=9e99066fd70a9dd9a291a523afba1a390f0e3a0b;p=friendica.git diff --git a/mod/msearch.php b/mod/msearch.php index a652bc8ed8..0d7cca4ff1 100644 --- a/mod/msearch.php +++ b/mod/msearch.php @@ -21,7 +21,7 @@ function msearch_post(App $a) { if (DBM::is_result($r)) $total = $r[0]['total']; - $results = array(); + $results = []; $r = q("SELECT `pub_keywords`, `username`, `nickname`, `user`.`uid` FROM `user` LEFT JOIN `profile` ON `user`.`uid` = `profile`.`uid` WHERE `is-default` = 1 AND `user`.`hidewall` = 0 AND MATCH `pub_keywords` AGAINST ('%s') LIMIT %d , %d ", dbesc($search), @@ -31,15 +31,15 @@ function msearch_post(App $a) { if (DBM::is_result($r)) { foreach($r as $rr) - $results[] = array( + $results[] = [ 'name' => $rr['name'], 'url' => System::baseUrl() . '/profile/' . $rr['nickname'], 'photo' => System::baseUrl() . '/photo/avatar/' . $rr['uid'] . '.jpg', - 'tags' => str_replace(array(',',' '),array(' ',' '),$rr['pub_keywords']) - ); + 'tags' => str_replace([',',' '],[' ',' '],$rr['pub_keywords']) + ]; } - $output = array('total' => $total, 'items_page' => $perpage, 'page' => $page + 1, 'results' => $results); + $output = ['total' => $total, 'items_page' => $perpage, 'page' => $page + 1, 'results' => $results]; echo json_encode($output);