fix magic quotes.
This commit is contained in:
27
vendor/Symfony/Component/HTTPFoundation/LaravelRequest.php
vendored
Normal file
27
vendor/Symfony/Component/HTTPFoundation/LaravelRequest.php
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php namespace Symfony\Component\HttpFoundation;
|
||||
|
||||
class LaravelRequest extends Request {
|
||||
|
||||
/**
|
||||
* Creates a new request with values from PHP's super globals.
|
||||
*
|
||||
* @return Request A new request
|
||||
*
|
||||
* @api
|
||||
*/
|
||||
static public function createFromGlobals()
|
||||
{
|
||||
$request = new static($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER);
|
||||
|
||||
if (0 === strpos($request->server->get('CONTENT_TYPE'), 'application/x-www-form-urlencoded')
|
||||
&& in_array(strtoupper($request->server->get('REQUEST_METHOD', 'GET')), array('PUT', 'DELETE', 'PATCH'))
|
||||
) {
|
||||
parse_str($request->getContent(), $data);
|
||||
if (magic_quotes()) $data = array_strip_slashes($data);
|
||||
$request->request = new ParameterBag($data);
|
||||
}
|
||||
|
||||
return $request;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user