use Friendica\Module\Special\HTTPException as ModuleHTTPException;
use Friendica\Network\HTTPException;
use Friendica\Util\DateTimeFormat;
+use Friendica\Util\HTTPInputData;
use Friendica\Util\HTTPSignature;
use Friendica\Util\Profiler;
use Friendica\Util\Strings;
$module = $router->getModule();
}
+ // Processes data from GET requests
+ $httpinput = HTTPInputData::process();
+ $input = array_merge($httpinput['variables'], $httpinput['files'], $request ?? $_REQUEST);
+
// Let the module run it's internal process (init, get, post, ...)
- $response = $module->run($_POST, $_REQUEST);
+ $response = $module->run($input);
if ($response->getHeaderLine(ICanCreateResponses::X_HEADER) === ICanCreateResponses::TYPE_HTML) {
$page->run($this, $this->baseURL, $this->args, $this->mode, $response, $this->l10n, $this->profiler, $this->config, $pconfig);
} else {
*
* Extend this method if the module is supposed to process DELETE requests.
* Doesn't display any content
+ *
+ * @param string[] $request The $_REQUEST content
*/
- protected function delete()
+ protected function delete(array $request = [])
{
}
*
* Extend this method if the module is supposed to process PATCH requests.
* Doesn't display any content
+ *
+ * @param string[] $request The $_REQUEST content
*/
- protected function patch()
+ protected function patch(array $request = [])
{
}
* Doesn't display any content
*
* @param string[] $request The $_REQUEST content
- * @param string[] $post The $_POST content
*
*/
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
// $this->baseUrl->redirect('module');
}
*
* Extend this method if the module is supposed to process PUT requests.
* Doesn't display any content
+ *
+ * @param string[] $request The $_REQUEST content
*/
- protected function put()
+ protected function put(array $request = [])
{
}
/**
* {@inheritDoc}
*/
- public function run(array $post = [], array $request = []): ResponseInterface
+ public function run(array $request = []): ResponseInterface
{
// @see https://github.com/tootsuite/mastodon/blob/c3aef491d66aec743a3a53e934a494f653745b61/config/initializers/cors.rb
if (substr($request['pagename'] ?? '', 0, 12) == '.well-known/') {
switch ($this->server['REQUEST_METHOD'] ?? Router::GET) {
case Router::DELETE:
- $this->delete();
+ $this->delete($request);
break;
case Router::PATCH:
- $this->patch();
+ $this->patch($request);
break;
case Router::POST:
- Core\Hook::callAll($this->args->getModuleName() . '_mod_post', $post);
- $this->post($request, $post);
+ Core\Hook::callAll($this->args->getModuleName() . '_mod_post', $request);
+ $this->post($request);
break;
case Router::PUT:
- $this->put();
+ $this->put($request);
break;
}
$arr = ['content' => ''];
Hook::callAll(static::class . '_mod_content', $arr);
$this->response->addContent($arr['content']);
- $this->response->addContent($this->content($_REQUEST));
+ $this->response->addContent($this->content($request));
} catch (HTTPException $e) {
$this->response->addContent((new ModuleHTTPException())->content($e));
} finally {
interface ICanHandleRequests
{
/**
- * @param array $post The $_POST content (in case of POST)
- * @param array $request The $_REQUEST content (in case of GET, POST)
+ * @param array $request The $_REQUEST content (including content from the PHP input stream)
*
* @return ResponseInterface responding to the request handling
*
* @throws HTTPException\InternalServerErrorException
*/
- public function run(array $post = [], array $request = []): ResponseInterface;
+ public function run(array $request = []): ResponseInterface;
}
return $this->runModuleFunction('content');
}
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
- parent::post($post);
+ parent::post($request);
$this->runModuleFunction('post');
}
class Details extends BaseAdmin
{
- public function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAdminAccess();
class Contact extends BaseAdmin
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAdminAccess();
class Add extends BaseAdmin
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAdminAccess();
class Index extends BaseAdmin
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAdminAccess();
class Features extends BaseAdmin
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAdminAccess();
use Friendica\DI;
use Friendica\Model\Item;
use Friendica\Module\BaseAdmin;
-use Friendica\Util\Strings;
class Delete extends BaseAdmin
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAdminAccess();
use Friendica\Core\Renderer;
use Friendica\DI;
use Friendica\Module\BaseAdmin;
-use Friendica\Util\Strings;
use Psr\Log\LogLevel;
class Settings extends BaseAdmin
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAdminAccess();
class Site extends BaseAdmin
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAdminAccess();
class Storage extends BaseAdmin
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAdminAccess();
}
}
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAdminAccess();
$this->config = $config;
}
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAdminAccess();
class Active extends BaseUsers
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAdminAccess();
class Blocked extends BaseUsers
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAdminAccess();
class Create extends BaseUsers
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAdminAccess();
class Deleted extends BaseUsers
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAdminAccess();
class Index extends BaseUsers
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAdminAccess();
class Pending extends BaseUsers
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAdminAccess();
use Friendica\Module\Response;
use Friendica\Util\Arrays;
use Friendica\Util\DateTimeFormat;
-use Friendica\Util\HTTPInputData;
use Friendica\Util\XML;
use Psr\Log\LoggerInterface;
use Friendica\Factory\Api\Twitter\User as TwitterUser;
* Quit execution with the message that the endpoint isn't implemented
*
* @param string $method
+ * @param array $request (optional) The request content of the current call for later analysis
*
* @return void
* @throws \Exception
*/
- public function unsupported(string $method = 'all')
+ public function unsupported(string $method = 'all', array $request = [])
{
$path = $this->args->getQueryString();
$this->logger->info('Unimplemented API call',
'method' => $method,
'path' => $path,
'agent' => $_SERVER['HTTP_USER_AGENT'] ?? '',
- 'request' => HTTPInputData::process()
+ 'request' => $request,
]);
$error = $this->l10n->t('API endpoint %s %s is not implemented', strtoupper($method), $path);
$error_description = $this->l10n->t('The API endpoint is currently not implemented but might be in the future.');
*/
class Index extends BaseApi
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
}
- protected function delete()
+ protected function delete(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
}
*/
class Block extends BaseApi
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_FOLLOW);
$uid = self::getCurrentUserID();
*/
class Follow extends BaseApi
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_FOLLOW);
$uid = self::getCurrentUserID();
*/
class Mute extends BaseApi
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_FOLLOW);
$uid = self::getCurrentUserID();
*/
class Note extends BaseApi
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
*/
class Unblock extends BaseApi
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_FOLLOW);
$uid = self::getCurrentUserID();
*/
class Unfollow extends BaseApi
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_FOLLOW);
$uid = self::getCurrentUserID();
*/
class Unmute extends BaseApi
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_FOLLOW);
$uid = self::getCurrentUserID();
use Friendica\App\Router;
use Friendica\Core\Logger;
use Friendica\Module\BaseApi;
-use Friendica\Util\HTTPInputData;
/**
* @see https://docs.joinmastodon.org/methods/accounts/
*/
class UpdateCredentials extends BaseApi
{
- protected function patch()
+ protected function patch(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
- $data = HTTPInputData::process();
+ Logger::info('Patch data', ['data' => $request]);
- Logger::info('Patch data', ['data' => $data]);
-
- $this->response->unsupported(Router::PATCH);
+ $this->response->unsupported(Router::PATCH, $request);
}
}
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
$request = $this->getRequest([
'client_name' => '',
*/
class Conversations extends BaseApi
{
- protected function delete()
+ protected function delete(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
*/
class Read extends BaseApi
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
*/
class Filters extends BaseApi
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
- $this->response->unsupported(Router::POST);
+ $this->response->unsupported(Router::POST, $request);
}
/**
* @see https://docs.joinmastodon.org/methods/accounts/follow_requests#accept-follow
* @see https://docs.joinmastodon.org/methods/accounts/follow_requests#reject-follow
*/
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_FOLLOW);
$uid = self::getCurrentUserID();
*/
class Lists extends BaseApi
{
- protected function delete()
+ protected function delete(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
System::jsonExit([]);
}
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
System::jsonExit(DI::mstdnList()->createFromGroupId($id));
}
- public function put()
+ public function put(array $request = [])
{
$request = $this->getRequest([
'title' => '', // The title of the list to be updated.
*/
class Accounts extends BaseApi
{
- protected function delete()
+ protected function delete(array $request = [])
{
- $this->response->unsupported(Router::DELETE);
+ $this->response->unsupported(Router::DELETE, $request);
}
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
- $this->response->unsupported(Router::POST);
+ $this->response->unsupported(Router::POST, $request);
}
/**
*/
class Markers extends BaseApi
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
- $this->response->unsupported(Router::POST);
+ $this->response->unsupported(Router::POST, $request);
}
/**
*/
class Media extends BaseApi
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
System::jsonExit(DI::mstdnAttachment()->createFromPhoto($media['id']));
}
- public function put()
+ public function put(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
*/
class Clear extends BaseApi
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
*/
class Dismiss extends BaseApi
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
*/
class PushSubscription extends BaseApi
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_PUSH);
$uid = self::getCurrentUserID();
return DI::mstdnSubscription()->createForApplicationIdAndUserId($application['id'], $uid)->toArray();
}
- public function put()
+ public function put(array $request = [])
{
self::checkAllowedScope(self::SCOPE_PUSH);
$uid = self::getCurrentUserID();
return DI::mstdnSubscription()->createForApplicationIdAndUserId($application['id'], $uid)->toArray();
}
- protected function delete()
+ protected function delete(array $request = [])
{
self::checkAllowedScope(self::SCOPE_PUSH);
$uid = self::getCurrentUserID();
*/
class ScheduledStatuses extends BaseApi
{
- public function put()
+ public function put(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
- $this->response->unsupported(Router::PUT);
+ $this->response->unsupported(Router::PUT, $request);
}
- protected function delete()
+ protected function delete(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
*/
class Statuses extends BaseApi
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
DI::mstdnError()->InternalError();
}
- protected function delete()
+ protected function delete(array $request = [])
{
self::checkAllowedScope(self::SCOPE_READ);
$uid = self::getCurrentUserID();
*/
class Bookmark extends BaseApi
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
*/
class Favourite extends BaseApi
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
*/
class Mute extends BaseApi
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
*/
class Pin extends BaseApi
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
*/
class Reblog extends BaseApi
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
*/
class Unbookmark extends BaseApi
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
*/
class Unfavourite extends BaseApi
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
*/
class Unmute extends BaseApi
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
*/
class Unpin extends BaseApi
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
*/
class Unreblog extends BaseApi
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- protected function delete()
+ protected function delete(array $request = [])
{
- $this->response->unsupported(Router::DELETE);
+ $this->response->unsupported(Router::DELETE, $request);
}
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- protected function patch()
+ protected function patch(array $request = [])
{
- $this->response->unsupported(Router::PATCH);
+ $this->response->unsupported(Router::PATCH, $request);
}
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
- $this->response->unsupported(Router::POST);
+ $this->response->unsupported(Router::POST, $request);
}
/**
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- public function put()
+ public function put(array $request = [])
{
- $this->response->unsupported(Router::PUT);
+ $this->response->unsupported(Router::PUT, $request);
}
/**
*/
protected function rawContent(array $request = [])
{
- $this->response->unsupported(Router::GET);
+ $this->response->unsupported(Router::GET, $request);
}
}
use Friendica\Security\BasicAuth;
use Friendica\Security\OAuth;
use Friendica\Util\DateTimeFormat;
-use Friendica\Util\HTTPInputData;
use Friendica\Util\Profiler;
use Psr\Log\LoggerInterface;
$this->app = $app;
}
- protected function delete()
+ protected function delete(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
}
}
- protected function patch()
+ protected function patch(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
}
}
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
}
}
- public function put()
+ public function put(array $request = [])
{
self::checkAllowedScope(self::SCOPE_WRITE);
*
* @param array $defaults Associative array of expected request keys and their default typed value. A null
* value will remove the request key from the resulting value array.
- * @param array|null $request Custom REQUEST array, superglobal instead
+ * @param array $request Custom REQUEST array, superglobal instead
* @return array request data
* @throws \Exception
*/
- public function getRequest(array $defaults, array $request = null): array
+ public function getRequest(array $defaults, array $request): array
{
- $httpinput = HTTPInputData::process();
- $input = array_merge($httpinput['variables'], $httpinput['files'], $request ?? $_REQUEST);
-
- self::$request = $input;
+ self::$request = $request;
self::$boundaries = [];
unset(self::$request['pagename']);
- return $this->checkDefaults($defaults, $input);
+ return $this->checkDefaults($defaults, $request);
}
/**
DI::baseUrl()->redirect($redirectUrl);
}
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
if (!local_user()) {
return;
}
}
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
$cid = $this->parameters['id'];
class Poke extends BaseModule
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
if (!local_user() || empty($this->parameters['id'])) {
return self::postReturn(false);
$this->config = $config;
}
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
if (!local_user()) {
return;
}
}
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
if (!local_user()) {
throw new HTTPException\UnauthorizedException();
*/
class Notify extends BaseModule
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
$postdata = Network::postdata();
{
static $mod_localtime = '';
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
$time = ($_REQUEST['time'] ?? '') ?: 'now';
*/
class Delegation extends BaseModule
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
if (!local_user()) {
return;
$this->config = $config;
}
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
$enabled = $this->config->get('system', 'diaspora_enabled', false);
if (!$enabled) {
*/
class FollowConfirm extends BaseModule
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
- parent::post($post);
+ parent::post($request);
$uid = local_user();
if (!$uid) {
notice(DI::l10n()->t('Permission denied.'));
$this->friendSuggestFac = $friendSuggestFac;
}
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
$cid = intval($this->parameters['contact']);
class Group extends BaseModule
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
if (DI::mode()->isAjax()) {
$this->ajaxPost();
if ((DI::args()->getArgc() == 2) && (DI::args()->getArgv()[1] === 'new')) {
BaseModule::checkFormSecurityTokenRedirectOnError('/group/new', 'group_edit');
- $name = trim($_POST['groupname']);
+ $name = trim($request['groupname']);
$r = Model\Group::create(local_user(), $name);
if ($r) {
$r = Model\Group::getIdByName(local_user(), $name);
throw new HTTPException\NotFoundException(DI::l10n()->t('Page not found.'));
}
- public function run(array $post = [], array $request = []): ResponseInterface
+ public function run(array $request = []): ResponseInterface
{
/* The URL provided does not resolve to a valid module.
*
'query' => $this->server['QUERY_STRING']
]);
- return parent::run($post, $request); // TODO: Change the autogenerated stub
+ return parent::run($request); // TODO: Change the autogenerated stub
}
}
$this->currentWizardStep = ($_POST['pass'] ?? '') ?: self::SYSTEM_CHECK;
}
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
$configCache = $this->app->getConfigCache();
*/
class Invite extends BaseModule
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
if (!local_user()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
class Compose extends BaseModule
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
if (!empty($_REQUEST['body'])) {
$_REQUEST['return'] = 'network';
* @throws \ImagickException
* @throws \Exception
*/
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
if (!local_user()) {
throw new HTTPException\UnauthorizedException(DI::l10n()->t('Permission denied.'));
*/
class Acknowledge extends BaseApi
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
DI::session()->set('oauth_acknowledge', true);
DI::app()->redirect(DI::session()->get('return_path'));
*/
class Revoke extends BaseApi
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
$request = $this->getRequest([
'client_id' => '', // Client ID, obtained during app registration
*/
class Token extends BaseApi
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
$request = $this->getRequest([
'client_id' => '', // Client ID, obtained during app registration
class Schedule extends BaseProfile
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
if (!local_user()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
* Extend this method if the module is supposed to process POST requests.
* Doesn't display any content
*/
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
BaseModule::checkFormSecurityTokenRedirectOnError('/register', 'register');
$this->page = $page;
}
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
if (!empty($_POST['cancel']) || empty($_POST['dfrn_url'])) {
$this->baseUrl->redirect();
return self::form(Session::get('return_path'), intval(DI::config()->get('config', 'register_policy')) !== \Friendica\Module\Register::CLOSED);
}
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
$return_path = Session::get('return_path');
Session::clear();
$this->session = $session;
}
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
if (!local_user()) {
return;
{
private static $errors = [];
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
if (!local_user()) {
return;
*/
class Delegation extends BaseSettings
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
if (!DI::app()->isLoggedIn()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
*/
class Display extends BaseSettings
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
if (!DI::app()->isLoggedIn()) {
throw new HTTPException\ForbiddenException(DI::l10n()->t('Permission denied.'));
class Index extends BaseSettings
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
if (!local_user()) {
return;
class Crop extends BaseSettings
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
if (!Session::isAuthenticated()) {
return;
class Index extends BaseSettings
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
if (!Session::isAuthenticated()) {
return;
}
}
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
if (!local_user()) {
return;
class Index extends BaseSettings
{
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
if (!local_user()) {
return;
}
}
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
if (!local_user()) {
return;
}
}
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
if (!local_user()) {
return;
}
}
- protected function post(array $request = [], array $post = [])
+ protected function post(array $request = [])
{
if (!local_user()) {
return;
$this->loadFixture(__DIR__ . '/../../../../../datasets/photo/photo.fixture.php', DI::dba());
$delete = new Delete(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::POST]);
- $response = $delete->run([], ['photo_id' => '709057080661a283a6aa598501504178']);
+ $response = $delete->run(['photo_id' => '709057080661a283a6aa598501504178']);
$responseText = (string)$response->getBody();
$this->loadFixture(__DIR__ . '/../../../../../datasets/photo/photo.fixture.php', DI::dba());
$delete = new Delete(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::DELETE]);
- $response = $delete->run([], ['photo_id' => '709057080661a283a6aa598501504178']);
+ $response = $delete->run(['photo_id' => '709057080661a283a6aa598501504178']);
$responseText = (string)$response->getBody();
$this->loadFixture(__DIR__ . '/../../../../../datasets/photo/photo.fixture.php', DI::dba());
$delete = new Delete(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::DELETE]);
- $response = $delete->run([], ['album' => 'test_album']);
+ $response = $delete->run(['album' => 'test_album']);
$responseText = (string)$response->getBody();
{
$this->loadFixture(__DIR__ . '/../../../../../datasets/photo/photo.fixture.php', DI::dba());
- $response = (new Update(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::POST]))->run([], ['album' => 'test_album', 'album_new' => 'test_album_2']);
+ $response = (new Update(DI::app(), DI::l10n(), DI::baseUrl(), DI::args(), DI::logger(), DI::profiler(), DI::apiResponse(), ['REQUEST_METHOD' => Router::POST]))->run(['album' => 'test_album', 'album_new' => 'test_album_2']);
$responseBody = (string)$response->getBody();