HomeDevCentral

Avoid $_POST direct use

Description

Avoid $_POST direct use

Summary:
Frameworks like Laravel offers wrappers around superglobals.

It allows a more versatile code (but $_REQUEST would do too),
and some sanitization.

Test Plan:
(1) Capture a request (for example through Runscope) with this code:

protected function extractPayload () {
	$this->payload = $_POST;
	print_r($_POST);
	abort(503, "Debugging payload");
}

(2) Replace by $this->payload = Request::all();.

(3) Replay the request, and check if the reply diff is identical

Reviewers: dereckson

Differential Revision: http://devcentral.nasqueron.org/D119

Details

Provenance
derecksonAuthored on
Differential Revision
D119: Avoid $_POST direct use
Parents
rNOTIFe36b14ef82bc: PHPMD: naming and cleancode rules
Branches
Unknown
Tags
Unknown