Skip to content

Commit c71f1ab

Browse files
committed
PHP 7.4 deprecates get_magic_quotes_gpc. Instead of checking the php-version on every pageload, let's drop PHP 5.3 support.
1 parent 2d344fa commit c71f1ab

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lib/request/sfWebRequest.class.php

+9-3
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ public function initialize(sfEventDispatcher $dispatcher, $parameters = array(),
7575
parent::initialize($dispatcher, $parameters, $attributes, $options);
7676

7777
// GET parameters
78-
$this->getParameters = get_magic_quotes_gpc() ? sfToolkit::stripslashesDeep($_GET) : $_GET;
78+
// REMARK: Since PHP 5.4 get_magic_quotes_gpc always returns false... Since 7.4 it's deprecated.
79+
//$this->getParameters = get_magic_quotes_gpc() ? sfToolkit::stripslashesDeep($_GET) : $_GET;
80+
$this->getParameters = $_GET;
7981
$this->parameterHolder->add($this->getParameters);
8082

8183
$postParameters = $_POST;
@@ -148,7 +150,9 @@ public function initialize(sfEventDispatcher $dispatcher, $parameters = array(),
148150
$this->setMethod(self::GET);
149151
}
150152

151-
$this->postParameters = get_magic_quotes_gpc() ? sfToolkit::stripslashesDeep($postParameters) : $postParameters;
153+
// REMARK: Since PHP 5.4 get_magic_quotes_gpc always returns false... Since 7.4 it's deprecated.
154+
//$this->postParameters = get_magic_quotes_gpc() ? sfToolkit::stripslashesDeep($postParameters) : $postParameters;
155+
$this->postParameters = $postParameters;
152156
$this->parameterHolder->add($this->postParameters);
153157

154158
if ($formats = $this->getOption('formats'))
@@ -600,7 +604,9 @@ public function getCookie($name, $defaultValue = null)
600604

601605
if (isset($_COOKIE[$name]))
602606
{
603-
$retval = get_magic_quotes_gpc() ? sfToolkit::stripslashesDeep($_COOKIE[$name]) : $_COOKIE[$name];
607+
// REMARK: Since PHP 5.4 get_magic_quotes_gpc always returns false... Since 7.4 it's deprecated.
608+
//$retval = get_magic_quotes_gpc() ? sfToolkit::stripslashesDeep($_COOKIE[$name]) : $_COOKIE[$name];
609+
$retval = $_COOKIE[$name];
604610
}
605611

606612
return $retval;

0 commit comments

Comments
 (0)