$value = max(filter_var($minimal_value, FILTER_VALIDATE_INT), $value);
}
if (!is_null($maximum_value)) {
- $value = min(filter_var($minimal_value, FILTER_VALIDATE_INT), $value);
+ $value = min(filter_var($maximum_value, FILTER_VALIDATE_INT), $value);
}
} elseif (is_float($default)) {
$value = filter_var($input[$parameter] ?? $default, FILTER_VALIDATE_FLOAT);
$value = max(filter_var($minimal_value, FILTER_VALIDATE_FLOAT), $value);
}
if (!is_null($maximum_value)) {
- $value = min(filter_var($minimal_value, FILTER_VALIDATE_FLOAT), $value);
+ $value = min(filter_var($maximum_value, FILTER_VALIDATE_FLOAT), $value);
}
} elseif (is_array($default)) {
$value = filter_var($input[$parameter] ?? $default, FILTER_DEFAULT, ['flags' => FILTER_FORCE_ARRAY]);
$id = intval($request['id'] ?? 0);
+ $include_entities = $this->getRequestValue($request, 'include_entities', false);
+
try {
$Notify = DI::notify()->selectOneById($id);
if ($Notify->uid !== $uid) {
if ($Notify->otype === Notification\ObjectType::ITEM) {
$item = Post::selectFirstForUser($uid, [], ['id' => $Notify->iid, 'uid' => $uid]);
if (DBA::isResult($item)) {
- $include_entities = filter_var($request['include_entities'] ?? false, FILTER_VALIDATE_BOOLEAN);
-
// we found the item, return it to the user
$ret = [DI::twitterStatus()->createFromUriId($item['uri-id'], $item['uid'], $include_entities)->toArray()];
$data = ['status' => $ret];
$uid = BaseApi::getCurrentUserID();
// params
- $id = $this->parameters['id'] ?? 0;
- $since_id = $this->getRequestValue($request, 'since_id', 0, 0);
- $max_id = $this->getRequestValue($request, 'max_id', 0, 0);
- $count = $this->getRequestValue($request, 'count', 20, 1, 100);
- $page = $this->getRequestValue($request, 'page', 1, 1);
+ $id = $this->parameters['id'] ?? 0;
+ $since_id = $this->getRequestValue($request, 'since_id', 0, 0);
+ $max_id = $this->getRequestValue($request, 'max_id', 0, 0);
+ $count = $this->getRequestValue($request, 'count', 20, 1, 100);
+ $page = $this->getRequestValue($request, 'page', 1, 1);
+ $include_entities = $this->getRequestValue($request, 'include_entities', false);
$start = max(0, ($page - 1) * $count);
throw new BadRequestException("There is no status with id $id.");
}
- $include_entities = filter_var($request['include_entities'] ?? false, FILTER_VALIDATE_BOOLEAN);
-
$ret = [];
while ($status = DBA::fetch($statuses)) {
$ret[] = DI::twitterStatus()->createFromUriId($status['uri-id'], $status['uid'], $include_entities)->toArray();
}
// params
- $count = $this->getRequestValue($request, 'count', 20, 1, 100);
- $page = $this->getRequestValue($request, 'page', 1, 1);
- $since_id = $this->getRequestValue($request, 'since_id', 0, 0);
- $max_id = $this->getRequestValue($request, 'max_id', 0, 0);
- $exclude_replies = $this->getRequestValue($request, 'exclude_replies', false);
- $conversation_id = $this->getRequestValue($request, 'conversation_id', 0, 0);
+ $count = $this->getRequestValue($request, 'count', 20, 1, 100);
+ $page = $this->getRequestValue($request, 'page', 1, 1);
+ $since_id = $this->getRequestValue($request, 'since_id', 0, 0);
+ $max_id = $this->getRequestValue($request, 'max_id', 0, 0);
+ $exclude_replies = $this->getRequestValue($request, 'exclude_replies', false);
+ $conversation_id = $this->getRequestValue($request, 'conversation_id', 0, 0);
+ $include_entities = $this->getRequestValue($request, 'include_entities', false);
$start = max(0, ($page - 1) * $count);
$params = ['order' => ['id' => true], 'limit' => [$start, $count]];
$statuses = Post::selectForUser($uid, [], $condition, $params);
- $include_entities = filter_var($request['include_entities'] ?? false, FILTER_VALIDATE_BOOLEAN);
-
$items = [];
while ($status = $this->dba->fetch($statuses)) {
$items[] = $this->twitterStatus->createFromUriId($status['uri-id'], $status['uid'], $include_entities)->toArray();
$max_id = $_REQUEST['max_id'] ?? 0;
$page = $_REQUEST['page'] ?? 1;
+ $include_entities = $this->getRequestValue($request, 'include_entities', false);
+
$start = max(0, ($page - 1) * $count);
$params = ['order' => ['id' => true], 'limit' => [$start, $count]];
$statuses = $statuses ?: Post::selectForUser($uid, [], $condition, $params);
- $include_entities = filter_var($request['include_entities'] ?? false, FILTER_VALIDATE_BOOLEAN);
-
$ret = [];
while ($status = DBA::fetch($statuses)) {
$ret[] = DI::twitterStatus()->createFromUriId($status['uri-id'], $status['uid'], $include_entities)->toArray();
namespace Friendica\Module\Api\Twitter\Statuses;
-use Friendica\Core\Logger;
use Friendica\Module\BaseApi;
use Friendica\DI;
use Friendica\Model\Contact;
$this->logger->notice('API: api_statuses_destroy: ' . $id);
- $include_entities = filter_var($request['include_entities'] ?? false, FILTER_VALIDATE_BOOLEAN);
+ $include_entities = $this->getRequestValue($request, 'include_entities', false);
$ret = DI::twitterStatus()->createFromItemId($id, $uid, $include_entities)->toArray();
// get last network messages
// params
- $count = $this->getRequestValue($request, 'count', 20, 1, 100);
- $page = $this->getRequestValue($request, 'page', 1, 1);
- $since_id = $this->getRequestValue($request, 'since_id', 0, 0);
- $max_id = $this->getRequestValue($request, 'max_id', 0, 0);
- $exclude_replies = $this->getRequestValue($request, 'exclude_replies', false);
- $conversation_id = $this->getRequestValue($request, 'conversation_id', 0, 0);
+ $count = $this->getRequestValue($request, 'count', 20, 1, 100);
+ $page = $this->getRequestValue($request, 'page', 1, 1);
+ $since_id = $this->getRequestValue($request, 'since_id', 0, 0);
+ $max_id = $this->getRequestValue($request, 'max_id', 0, 0);
+ $exclude_replies = $this->getRequestValue($request, 'exclude_replies', false);
+ $include_entities = $this->getRequestValue($request, 'include_entities', false);
+ $conversation_id = $this->getRequestValue($request, 'conversation_id', 0, 0);
$start = max(0, ($page - 1) * $count);
$params = ['order' => ['id' => true], 'limit' => [$start, $count]];
$statuses = Post::selectForUser($uid, [], $condition, $params);
- $include_entities = filter_var($request['include_entities'] ?? false, FILTER_VALIDATE_BOOLEAN);
-
$ret = [];
$idarray = [];
while ($status = DBA::fetch($statuses)) {
// get last network messages
// params
- $count = $this->getRequestValue($request, 'count', 20, 1, 100);
- $page = $this->getRequestValue($request, 'page', 1, 1);
- $since_id = $this->getRequestValue($request, 'since_id', 0, 0);
- $max_id = $this->getRequestValue($request, 'max_id', 0, 0);
+ $count = $this->getRequestValue($request, 'count', 20, 1, 100);
+ $page = $this->getRequestValue($request, 'page', 1, 1);
+ $since_id = $this->getRequestValue($request, 'since_id', 0, 0);
+ $max_id = $this->getRequestValue($request, 'max_id', 0, 0);
+ $include_entities = $this->getRequestValue($request, 'include_entities', false);
$start = max(0, ($page - 1) * $count);
$params = ['order' => ['id' => true], 'limit' => [$start, $count]];
$statuses = Post::selectForUser($uid, [], $condition, $params);
- $include_entities = filter_var($request['include_entities'] ?? false, FILTER_VALIDATE_BOOLEAN);
-
$ret = [];
while ($status = DBA::fetch($statuses)) {
$ret[] = DI::twitterStatus()->createFromUriId($status['uri-id'], $status['uid'], $include_entities)->toArray();
BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
$uid = BaseApi::getCurrentUserID();
- $since_id = $_REQUEST['since_id'] ?? 0;
- $max_id = $_REQUEST['max_id'] ?? 0;
-
- // pagination
- $count = $_REQUEST['count'] ?? 20;
- $page = $_REQUEST['page'] ?? 1;
+ $count = $this->getRequestValue($request, 'count', 20, 1, 100);
+ $page = $this->getRequestValue($request, 'page', 1, 1);
+ $since_id = $this->getRequestValue($request, 'since_id', 0, 0);
+ $max_id = $this->getRequestValue($request, 'max_id', 0, 0);
+ $include_entities = $this->getRequestValue($request, 'include_entities', false);
$start = max(0, ($page - 1) * $count);
$params = ['order' => ['id' => true], 'limit' => [$start, $count]];
$statuses = Post::selectForUser($uid, Item::DISPLAY_FIELDLIST, $condition, $params);
- $include_entities = filter_var($request['include_entities'] ?? false, FILTER_VALIDATE_BOOLEAN);
-
$ret = [];
while ($status = DBA::fetch($statuses)) {
$ret[] = DI::twitterStatus()->createFromUriId($status['uri-id'], $status['uid'], $include_entities)->toArray();
// get last network messages
// params
- $count = $this->getRequestValue($request, 'count', 20, 1, 100);
- $page = $this->getRequestValue($request, 'page', 1, 1);
- $since_id = $this->getRequestValue($request, 'since_id', 0, 0);
- $max_id = $this->getRequestValue($request, 'max_id', 0, 0);
- $exclude_replies = $this->getRequestValue($request, 'exclude_replies', false);
- $conversation_id = $this->getRequestValue($request, 'conversation_id', 0, 0);
+ $count = $this->getRequestValue($request, 'count', 20, 1, 100);
+ $page = $this->getRequestValue($request, 'page', 1, 1);
+ $since_id = $this->getRequestValue($request, 'since_id', 0, 0);
+ $max_id = $this->getRequestValue($request, 'max_id', 0, 0);
+ $exclude_replies = $this->getRequestValue($request, 'exclude_replies', false);
+ $conversation_id = $this->getRequestValue($request, 'conversation_id', 0, 0);
+ $include_entities = $this->getRequestValue($request, 'include_entities', false);
$start = max(0, ($page - 1) * $count);
$statuses = Post::selectForUser($uid, [], $condition, $params);
}
- $include_entities = filter_var($request['include_entities'] ?? false, FILTER_VALIDATE_BOOLEAN);
-
$ret = [];
while ($status = DBA::fetch($statuses)) {
$ret[] = DI::twitterStatus()->createFromUriId($status['uri-id'], $status['uid'], $include_entities)->toArray();
throw new BadRequestException(sprintf("There is no status or conversation with the id %d.", $id));
}
- $include_entities = filter_var($request['include_entities'] ?? false, FILTER_VALIDATE_BOOLEAN);
+ $include_entities = $this->getRequestValue($request, 'include_entities', false);
$ret = [];
while ($status = DBA::fetch($statuses)) {
Logger::info('api_statuses_user_timeline', ['api_user' => $uid, '_REQUEST' => $request]);
- $cid = BaseApi::getContactIDForSearchterm($request['screen_name'] ?? '', $request['profileurl'] ?? '', $request['user_id'] ?? 0, $uid);
- $since_id = $request['since_id'] ?? 0;
- $max_id = $request['max_id'] ?? 0;
- $exclude_replies = !empty($request['exclude_replies']);
- $conversation_id = $request['conversation_id'] ?? 0;
-
- // pagination
- $count = $request['count'] ?? 20;
- $page = $request['page'] ?? 1;
+ $cid = BaseApi::getContactIDForSearchterm($request['screen_name'] ?? '', $request['profileurl'] ?? '', $request['user_id'] ?? 0, $uid);
+ $count = $this->getRequestValue($request, 'count', 20, 1, 100);
+ $page = $this->getRequestValue($request, 'page', 1, 1);
+ $since_id = $this->getRequestValue($request, 'since_id', 0, 0);
+ $max_id = $this->getRequestValue($request, 'max_id', 0, 0);
+ $exclude_replies = $this->getRequestValue($request, 'exclude_replies', false);
+ $conversation_id = $this->getRequestValue($request, 'conversation_id', 0, 0);
+ $include_entities = $this->getRequestValue($request, 'include_entities', false);
$start = max(0, ($page - 1) * $count);
$params = ['order' => ['id' => true], 'limit' => [$start, $count]];
$statuses = Post::selectForUser($uid, [], $condition, $params);
- $include_entities = filter_var($request['include_entities'] ?? false, FILTER_VALIDATE_BOOLEAN);
-
$ret = [];
while ($status = DBA::fetch($statuses)) {
$ret[] = DI::twitterStatus()->createFromUriId($status['uri-id'], $status['uid'], $include_entities)->toArray();