local_user(), 'id' => $itemId]); if (empty($item)) { throw new \Friendica\Network\HTTPException\NotFoundException(); } $starred = !(bool)$item['starred']; Item::update(['starred' => $starred], ['id' => $itemId]); // See if we've been passed a return path to redirect to $returnPath = $_REQUEST['return'] ?? ''; if (!empty($returnPath)) { $rand = '_=' . time() . (strpos($returnPath, '?') ? '&' : '?') . 'rand'; DI::baseUrl()->redirect($returnPath . $rand); } // the json doesn't really matter, it will either be 0 or 1 echo json_encode((int)$starred); exit(); } }