4 use Friendica\Core\System;
5 use Friendica\Model\Item;
6 use Friendica\Util\Strings;
8 function like_content(App $a) {
9 if (!local_user() && !remote_user()) {
14 $verb = Strings::escapeTags(trim($_GET['verb']));
20 $item_id = (($a->argc > 1) ? Strings::escapeTags(trim($a->argv[1])) : 0);
22 $r = Item::performLike($item_id, $verb);
27 // See if we've been passed a return path to redirect to
28 $return_path = defaults($_REQUEST, 'return', '');
30 like_content_return($a, $return_path);
31 killme(); // NOTREACHED
35 // Decide how to return. If we were called with a 'return' argument,
36 // then redirect back to the calling page. If not, just quietly end
38 function like_content_return(App $a, $return_path) {
40 $rand = '_=' . time();
41 if (strpos($return_path, '?')) {
47 $a->internalRedirect($return_path . $rand);