Profile::publishUpdate($uid);
- $skip_status = filter_var($request['skip_status'] ?? false, FILTER_VALIDATE_BOOLEAN);
+ $skip_status = $this->getRequestValue($request, 'skip_status', false);
$user_info = DI::twitterUser()->createFromUserId($uid, $skip_status)->toArray();
}
// output for client
- $skip_status = filter_var($request['skip_status'] ?? false, FILTER_VALIDATE_BOOLEAN);
+ $skip_status = $this->getRequestValue($request, 'skip_status', false);
$user_info = DI::twitterUser()->createFromUserId($uid, $skip_status)->toArray();
BaseApi::checkAllowedScope(BaseApi::SCOPE_READ);
$uid = BaseApi::getCurrentUserID();
- $skip_status = filter_var($request['skip_status'] ?? false, FILTER_VALIDATE_BOOLEAN);
+ $skip_status = $this->getRequestValue($request, 'skip_status', false);
$user_info = DI::twitterUser()->createFromUserId($uid, $skip_status)->toArray();
$uid = BaseApi::getCurrentUserID();
// Expected value for user_id parameter: public/user contact id
- $cursor = filter_input(INPUT_GET, 'cursor' , FILTER_VALIDATE_INT, ['options' => ['default' => -1]]);
- $stringify_ids = filter_input(INPUT_GET, 'stringify_ids', FILTER_VALIDATE_BOOLEAN, ['options' => ['default' => false]]);
- $count = filter_input(INPUT_GET, 'count' , FILTER_VALIDATE_INT, ['options' => [
- 'default' => self::DEFAULT_COUNT,
- 'min_range' => 1,
- 'max_range' => self::MAX_COUNT,
- ]]);
+ $cursor = $this->getRequestValue($request, 'cursor', -1);
+ $stringify_ids = $this->getRequestValue($request, 'stringify_ids', false);
+ $count = $this->getRequestValue($request, 'count', self::DEFAULT_COUNT, 1, self::MAX_COUNT);
+
// Friendica-specific
- $since_id = filter_input(INPUT_GET, 'since_id', FILTER_VALIDATE_INT);
- $max_id = filter_input(INPUT_GET, 'max_id' , FILTER_VALIDATE_INT);
- $min_id = filter_input(INPUT_GET, 'min_id' , FILTER_VALIDATE_INT);
+ $since_id = $this->getRequestValue($request, 'since_id', 0, 0);
+ $max_id = $this->getRequestValue($request, 'max_id', 0, 0);
+ $min_id = $this->getRequestValue($request, 'min_id', 0, 0);
$params = ['order' => ['cid' => true], 'limit' => $count];
$uid = BaseApi::getCurrentUserID();
// Expected value for user_id parameter: public/user contact id
- $cursor = filter_input(INPUT_GET, 'cursor' , FILTER_VALIDATE_INT, ['options' => ['default' => -1]]);
- $skip_status = filter_input(INPUT_GET, 'skip_status' , FILTER_VALIDATE_BOOLEAN, ['options' => ['default' => false]]);
- $include_user_entities = filter_input(INPUT_GET, 'include_user_entities', FILTER_VALIDATE_BOOLEAN, ['options' => ['default' => false]]);
- $count = filter_input(INPUT_GET, 'count' , FILTER_VALIDATE_INT, ['options' => [
- 'default' => self::DEFAULT_COUNT,
- 'min_range' => 1,
- 'max_range' => self::MAX_COUNT,
- ]]);
+ $cursor = $this->getRequestValue($request, 'cursor', -1);
+ $skip_status = $this->getRequestValue($request, 'skip_status', false);
+ $include_user_entities = $this->getRequestValue($request, 'include_user_entities', false);
+ $count = $this->getRequestValue($request, 'count', self::DEFAULT_COUNT, 1, self::MAX_COUNT);
+
// Friendica-specific
- $since_id = filter_input(INPUT_GET, 'since_id', FILTER_VALIDATE_INT);
- $max_id = filter_input(INPUT_GET, 'max_id' , FILTER_VALIDATE_INT);
- $min_id = filter_input(INPUT_GET, 'min_id' , FILTER_VALIDATE_INT);
+ $since_id = $this->getRequestValue($request, 'since_id', 0, 0);
+ $max_id = $this->getRequestValue($request, 'max_id', 0, 0);
+ $min_id = $this->getRequestValue($request, 'min_id', 0, 0);
$params = ['order' => ['cid' => true], 'limit' => $count];
BaseApi::checkAllowedScope(BaseApi::SCOPE_WRITE);
$uid = BaseApi::getCurrentUserID();
- $id = filter_var($request['id'] ?? 0, FILTER_VALIDATE_INT);
- $verbose = filter_var($request['friendica_verbose'] ?? false, FILTER_VALIDATE_BOOLEAN);
+ $id = $this->getRequestValue($request, 'id', 0);
+ $verbose = $this->getRequestValue($request, 'friendica_verbose', false);
$parenturi = $request['friendica_parenturi'] ?? '';
$uid = BaseApi::getCurrentUserID();
// Expected value for user_id parameter: public/user contact id
- $contact_id = filter_input(INPUT_GET, 'user_id' , FILTER_VALIDATE_INT);
- $screen_name = filter_input(INPUT_GET, 'screen_name');
- $profile_url = filter_input(INPUT_GET, 'profile_url');
- $cursor = filter_input(INPUT_GET, 'cursor' , FILTER_VALIDATE_INT, ['options' => ['default' => -1]]);
- $stringify_ids = filter_input(INPUT_GET, 'stringify_ids', FILTER_VALIDATE_BOOLEAN, ['options' => ['default' => false]]);
- $count = filter_input(INPUT_GET, 'count' , FILTER_VALIDATE_INT, ['options' => [
- 'default' => self::DEFAULT_COUNT,
- 'min_range' => 1,
- 'max_range' => self::MAX_COUNT,
- ]]);
+ $contact_id = $this->getRequestValue($request, 'user_id', 0);
+ $screen_name = $this->getRequestValue($request, 'screen_name', '');
+ $profile_url = $this->getRequestValue($request, 'profile_url', '');
+ $cursor = $this->getRequestValue($request, 'cursor', -1);
+ $stringify_ids = $this->getRequestValue($request, 'stringify_ids', false);
+ $count = $this->getRequestValue($request, 'count', self::DEFAULT_COUNT, 1, self::MAX_COUNT);
+
// Friendica-specific
- $since_id = filter_input(INPUT_GET, 'since_id' , FILTER_VALIDATE_INT);
- $max_id = filter_input(INPUT_GET, 'max_id' , FILTER_VALIDATE_INT);
- $min_id = filter_input(INPUT_GET, 'min_id' , FILTER_VALIDATE_INT);
+ $since_id = $this->getRequestValue($request, 'since_id', 0, 0);
+ $max_id = $this->getRequestValue($request, 'max_id', 0, 0);
+ $min_id = $this->getRequestValue($request, 'min_id', 0, 0);
$cid = BaseApi::getContactIDForSearchterm($screen_name, $profile_url, $contact_id, $uid);
$uid = BaseApi::getCurrentUserID();
// Expected value for user_id parameter: public/user contact id
- $contact_id = filter_input(INPUT_GET, 'user_id' , FILTER_VALIDATE_INT);
- $screen_name = filter_input(INPUT_GET, 'screen_name');
- $profile_url = filter_input(INPUT_GET, 'profile_url');
- $cursor = filter_input(INPUT_GET, 'cursor' , FILTER_VALIDATE_INT, ['options' => ['default' => -1]]);
- $skip_status = filter_input(INPUT_GET, 'skip_status' , FILTER_VALIDATE_BOOLEAN, ['options' => ['default' => false]]);
- $include_user_entities = filter_input(INPUT_GET, 'include_user_entities', FILTER_VALIDATE_BOOLEAN, ['options' => ['default' => false]]);
- $count = filter_input(INPUT_GET, 'count' , FILTER_VALIDATE_INT, ['options' => [
- 'default' => self::DEFAULT_COUNT,
- 'min_range' => 1,
- 'max_range' => self::MAX_COUNT,
- ]]);
+ $contact_id = $this->getRequestValue($request, 'user_id', 0);
+ $screen_name = $this->getRequestValue($request, 'screen_name', '');
+ $profile_url = $this->getRequestValue($request, 'profile_url', '');
+ $cursor = $this->getRequestValue($request, 'cursor', -1);
+ $skip_status = $this->getRequestValue($request, 'skip_status', false);
+ $include_user_entities = $this->getRequestValue($request, 'include_user_entities', false);
+ $count = $this->getRequestValue($request, 'count', self::DEFAULT_COUNT, 1, self::MAX_COUNT);
+
// Friendica-specific
- $since_id = filter_input(INPUT_GET, 'since_id', FILTER_VALIDATE_INT);
- $max_id = filter_input(INPUT_GET, 'max_id' , FILTER_VALIDATE_INT);
- $min_id = filter_input(INPUT_GET, 'min_id' , FILTER_VALIDATE_INT);
+ $since_id = $this->getRequestValue($request, 'since_id', 0, 0);
+ $max_id = $this->getRequestValue($request, 'max_id', 0, 0);
+ $min_id = $this->getRequestValue($request, 'min_id', 0, 0);
$cid = BaseApi::getContactIDForSearchterm($screen_name, $profile_url, $contact_id, $uid);
$uid = BaseApi::getCurrentUserID();
// Expected value for user_id parameter: public/user contact id
- $contact_id = filter_input(INPUT_GET, 'user_id' , FILTER_VALIDATE_INT);
- $screen_name = filter_input(INPUT_GET, 'screen_name');
- $profile_url = filter_input(INPUT_GET, 'profile_url');
- $cursor = filter_input(INPUT_GET, 'cursor' , FILTER_VALIDATE_INT, ['options' => ['default' => -1]]);
- $stringify_ids = filter_input(INPUT_GET, 'stringify_ids', FILTER_VALIDATE_BOOLEAN, ['options' => ['default' => false]]);
- $count = filter_input(INPUT_GET, 'count' , FILTER_VALIDATE_INT, ['options' => [
- 'default' => self::DEFAULT_COUNT,
- 'min_range' => 1,
- 'max_range' => self::MAX_COUNT,
- ]]);
+ $contact_id = $this->getRequestValue($request, 'user_id', 0);
+ $screen_name = $this->getRequestValue($request, 'screen_name', '');
+ $profile_url = $this->getRequestValue($request, 'profile_url', '');
+ $cursor = $this->getRequestValue($request, 'cursor', -1);
+ $stringify_ids = $this->getRequestValue($request, 'stringify_ids', false);
+ $count = $this->getRequestValue($request, 'count', self::DEFAULT_COUNT, 1, self::MAX_COUNT);
+
// Friendica-specific
- $since_id = filter_input(INPUT_GET, 'since_id' , FILTER_VALIDATE_INT);
- $max_id = filter_input(INPUT_GET, 'max_id' , FILTER_VALIDATE_INT);
- $min_id = filter_input(INPUT_GET, 'min_id' , FILTER_VALIDATE_INT);
+ $since_id = $this->getRequestValue($request, 'since_id', 0, 0);
+ $max_id = $this->getRequestValue($request, 'max_id', 0, 0);
+ $min_id = $this->getRequestValue($request, 'min_id', 0, 0);
$cid = BaseApi::getContactIDForSearchterm($screen_name, $profile_url, $contact_id, $uid);
$uid = BaseApi::getCurrentUserID();
// Expected value for user_id parameter: public/user contact id
- $contact_id = filter_input(INPUT_GET, 'user_id' , FILTER_VALIDATE_INT);
- $screen_name = filter_input(INPUT_GET, 'screen_name');
- $profile_url = filter_input(INPUT_GET, 'profile_url');
- $cursor = filter_input(INPUT_GET, 'cursor' , FILTER_VALIDATE_INT, ['options' => ['default' => -1]]);
- $skip_status = filter_input(INPUT_GET, 'skip_status' , FILTER_VALIDATE_BOOLEAN, ['options' => ['default' => false]]);
- $include_user_entities = filter_input(INPUT_GET, 'include_user_entities', FILTER_VALIDATE_BOOLEAN, ['options' => ['default' => false]]);
- $count = filter_input(INPUT_GET, 'count' , FILTER_VALIDATE_INT, ['options' => [
- 'default' => self::DEFAULT_COUNT,
- 'min_range' => 1,
- 'max_range' => self::MAX_COUNT,
- ]]);
+ $contact_id = $this->getRequestValue($request, 'user_id', 0);
+ $screen_name = $this->getRequestValue($request, 'screen_name', '');
+ $profile_url = $this->getRequestValue($request, 'profile_url', '');
+ $cursor = $this->getRequestValue($request, 'cursor', -1);
+ $skip_status = $this->getRequestValue($request, 'skip_status', false);
+ $include_user_entities = $this->getRequestValue($request, 'include_user_entities', false);
+ $count = $this->getRequestValue($request, 'count', self::DEFAULT_COUNT, 1, self::MAX_COUNT);
+
// Friendica-specific
- $since_id = filter_input(INPUT_GET, 'since_id', FILTER_VALIDATE_INT);
- $max_id = filter_input(INPUT_GET, 'max_id' , FILTER_VALIDATE_INT);
- $min_id = filter_input(INPUT_GET, 'min_id' , FILTER_VALIDATE_INT);
+ $since_id = $this->getRequestValue($request, 'since_id', 0, 0);
+ $max_id = $this->getRequestValue($request, 'max_id', 0, 0);
+ $min_id = $this->getRequestValue($request, 'min_id', 0, 0);
$cid = BaseApi::getContactIDForSearchterm($screen_name, $profile_url, $contact_id, $uid);
$uid = BaseApi::getCurrentUserID();
// Expected value for user_id parameter: public/user contact id
- $cursor = filter_input(INPUT_GET, 'cursor' , FILTER_VALIDATE_INT, ['options' => ['default' => -1]]);
- $stringify_ids = filter_input(INPUT_GET, 'stringify_ids', FILTER_VALIDATE_BOOLEAN, ['options' => ['default' => false]]);
- $count = filter_input(INPUT_GET, 'count' , FILTER_VALIDATE_INT, ['options' => [
- 'default' => self::DEFAULT_COUNT,
- 'min_range' => 1,
- 'max_range' => self::MAX_COUNT,
- ]]);
+ $cursor = $this->getRequestValue($request, 'cursor', -1);
+ $stringify_ids = $this->getRequestValue($request, 'stringify_ids', false);
+ $count = $this->getRequestValue($request, 'count', self::DEFAULT_COUNT, 1, self::MAX_COUNT);
+
// Friendica-specific
- $since_id = filter_input(INPUT_GET, 'since_id', FILTER_VALIDATE_INT);
- $max_id = filter_input(INPUT_GET, 'max_id' , FILTER_VALIDATE_INT);
- $min_id = filter_input(INPUT_GET, 'min_id' , FILTER_VALIDATE_INT);
+ $since_id = $this->getRequestValue($request, 'since_id', 0, 0);
+ $max_id = $this->getRequestValue($request, 'max_id', 0, 0);
+ $min_id = $this->getRequestValue($request, 'min_id', 0, 0);
$params = ['order' => ['cid' => true], 'limit' => $count];