Make $_REQUEST processing independent of sub-calls

- Move HTTPInputData::process() into App::runFrontend()
- Pass $_REQUEST (including processed Input) to every Module method
- Delete $_POST parameters at Module post() calls because of $_REQUEST
This commit is contained in:
Philipp 2021-11-28 13:44:42 +01:00 committed by Hypolite Petovan
parent f580d8e5c0
commit 2e4d654c0a
96 changed files with 156 additions and 156 deletions

View file

@ -40,6 +40,7 @@ use Friendica\Model\Profile;
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;
@ -702,8 +703,12 @@ class App
$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 {