Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Yeray Santana Hualde
syncEnrollments
Commits
8d169166
Commit
8d169166
authored
Mar 30, 2012
by
Taylor Otwell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix magic quotes.
parent
6234905e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
2 deletions
+50
-2
laravel.php
laravel/laravel.php
+23
-2
LaravelRequest.php
vendor/Symfony/Component/HTTPFoundation/LaravelRequest.php
+27
-0
No files found.
laravel/laravel.php
View file @
8d169166
...
@@ -55,6 +55,27 @@ register_shutdown_function(function()
...
@@ -55,6 +55,27 @@ register_shutdown_function(function()
error_reporting
(
-
1
);
error_reporting
(
-
1
);
/*
|--------------------------------------------------------------------------
| Magic Quotes Strip Slashes
|--------------------------------------------------------------------------
|
| Even though "Magic Quotes" are deprecated in PHP 5.3.x, they may still
| be enabled on the server. To account for this, we will strip slashes
| on all input arrays if magic quotes are enabled for the server.
|
*/
if
(
magic_quotes
())
{
$magics
=
array
(
&
$_GET
,
&
$_POST
,
&
$_COOKIE
,
&
$_REQUEST
);
foreach
(
$magics
as
&
$magic
)
{
$magic
=
array_strip_slashes
(
$magic
);
}
}
/*
/*
|--------------------------------------------------------------------------
|--------------------------------------------------------------------------
| Create The HttpFoundation Request
| Create The HttpFoundation Request
...
@@ -66,9 +87,9 @@ error_reporting(-1);
...
@@ -66,9 +87,9 @@ error_reporting(-1);
|
|
*/
*/
use
Symfony\Component\HttpFoundation\
Request
as
FoundationRequest
;
use
Symfony\Component\HttpFoundation\
LaravelRequest
as
RequestFoundation
;
Request
::
$foundation
=
FoundationRequest
::
createFromGlobals
();
Request
::
$foundation
=
RequestFoundation
::
createFromGlobals
();
/*
/*
|--------------------------------------------------------------------------
|--------------------------------------------------------------------------
...
...
vendor/Symfony/Component/HTTPFoundation/LaravelRequest.php
0 → 100644
View file @
8d169166
<?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
;
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment