4 use Friendica\Model\Item;
5 use Friendica\Util\Strings;
7 function like_content(App $a) {
8 if (!local_user() && !remote_user()) {
13 $verb = Strings::escapeTags(trim($_GET['verb']));
19 $item_id = (($a->argc > 1) ? Strings::escapeTags(trim($a->argv[1])) : 0);
21 $r = Item::performLike($item_id, $verb);
26 // See if we've been passed a return path to redirect to
27 $return_path = defaults($_REQUEST, 'return', '');
29 like_content_return($a, $return_path);
34 // Decide how to return. If we were called with a 'return' argument,
35 // then redirect back to the calling page. If not, just quietly end
37 function like_content_return(App $a, $return_path) {
39 $rand = '_=' . time();
40 if (strpos($return_path, '?')) {
46 $a->internalRedirect($return_path . $rand);