Skip to content

Commit

Permalink
removed magic_quotes methods
Browse files Browse the repository at this point in the history
  • Loading branch information
nutama committed Nov 22, 2020
1 parent 661fb5e commit 79e36ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
4 changes: 1 addition & 3 deletions lib/cache/sfFileCache.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,7 @@ protected function read($path, $type = self::READ_DATA)
@flock($fp, LOCK_SH);
clearstatcache(); // because the filesize can be cached by PHP itself...
$length = @filesize($path);
$mqr = get_magic_quotes_runtime();
set_magic_quotes_runtime(0);

switch ($type)
{
case self::READ_TIMEOUT:
Expand All @@ -240,7 +239,6 @@ protected function read($path, $type = self::READ_DATA)
default:
throw new sfConfigurationException(sprintf('Unknown type "%s".', $type));
}
set_magic_quotes_runtime($mqr);
@flock($fp, LOCK_UN);
@fclose($fp);

Expand Down
6 changes: 3 additions & 3 deletions lib/request/sfWebRequest.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ public function getCookie($name, $defaultValue = null)

if (isset($_COOKIE[$name]))
{
$retval = get_magic_quotes_gpc() ? sfToolkit::stripslashesDeep($_COOKIE[$name]) : $_COOKIE[$name];
$retval = $_COOKIE[$name];
}

return $retval;
Expand Down Expand Up @@ -1162,15 +1162,15 @@ protected function parseRequestParameters()
protected function loadParameters()
{
// GET parameters
$this->getParameters = get_magic_quotes_gpc() ? sfToolkit::stripslashesDeep($_GET) : $_GET;
$this->getParameters = $_GET;
$this->parameterHolder->add($this->getParameters);

// additional parameters
$this->requestParameters = $this->parseRequestParameters();
$this->parameterHolder->add($this->requestParameters);

// POST parameters
$this->postParameters = get_magic_quotes_gpc() ? sfToolkit::stripslashesDeep($_POST) : $_POST;
$this->postParameters = $_POST;
$this->parameterHolder->add($this->postParameters);

// move symfony parameters to attributes (parameters prefixed with _sf_)
Expand Down

0 comments on commit 79e36ce

Please sign in to comment.