Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
language: php

php:
- 5.5
- 5.6
- 7.0
- 7.1
- 7.2
- 7.3
- 7.4
- nightly

# run build against nightly but allow them to fail
Expand All @@ -20,6 +20,12 @@ matrix:
- php: 5.4
dist: precise
sudo: required
- php: 5.5
dist: trusty
sudo: required
- php: 5.6
dist: trusty
sudo: required

# faster builds on new travis setup not using sudo
sudo: false
Expand Down
6 changes: 3 additions & 3 deletions lib/i18n/sfDateFormat.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public function format($time, $pattern = 'F', $inputPattern = null, $charset = '
for ($i = 0, $max = count($tokens); $i < $max; $i++)
{
$pattern = $tokens[$i];
if ($pattern{0} == "'" && $pattern{strlen($pattern) - 1} == "'")
if ($pattern[0] == "'" && $pattern{strlen($pattern) - 1} == "'")
{
$tokens[$i] = str_replace('``````', '\'', preg_replace('/(^\')|(\'$)/', '', $pattern));
}
Expand Down Expand Up @@ -266,9 +266,9 @@ public function format($time, $pattern = 'F', $inputPattern = null, $charset = '
*/
protected function getFunctionName($token)
{
if (isset($this->tokens[$token{0}]))
if (isset($this->tokens[$token[0]]))
{
return $this->tokens[$token{0}];
return $this->tokens[$token[0]];
}
}

Expand Down
28 changes: 25 additions & 3 deletions lib/request/sfWebRequest.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,14 @@ public function initialize(sfEventDispatcher $dispatcher, $parameters = array(),
parent::initialize($dispatcher, $parameters, $attributes, $options);

// GET parameters
$this->getParameters = get_magic_quotes_gpc() ? sfToolkit::stripslashesDeep($_GET) : $_GET;
if (version_compare(PHP_VERSION, '5.4.0-dev', '<') && get_magic_quotes_gpc())
{
$this->getParameters = sfToolkit::stripslashesDeep($_GET);
}
else
{
$this->getParameters = $_GET;
}
$this->parameterHolder->add($this->getParameters);

$postParameters = $_POST;
Expand Down Expand Up @@ -148,7 +155,15 @@ public function initialize(sfEventDispatcher $dispatcher, $parameters = array(),
$this->setMethod(self::GET);
}

$this->postParameters = get_magic_quotes_gpc() ? sfToolkit::stripslashesDeep($postParameters) : $postParameters;
if (version_compare(PHP_VERSION, '5.4.0-dev', '<') && get_magic_quotes_gpc())
{
$this->postParameters = sfToolkit::stripslashesDeep($postParameters);
}
else
{
$this->postParameters = $postParameters;
}

$this->parameterHolder->add($this->postParameters);

if ($formats = $this->getOption('formats'))
Expand Down Expand Up @@ -600,7 +615,14 @@ public function getCookie($name, $defaultValue = null)

if (isset($_COOKIE[$name]))
{
$retval = get_magic_quotes_gpc() ? sfToolkit::stripslashesDeep($_COOKIE[$name]) : $_COOKIE[$name];
if (version_compare(PHP_VERSION, '5.4.0-dev', '<') && get_magic_quotes_gpc())
{
$retval = sfToolkit::stripslashesDeep($_COOKIE[$name]);
}
else
{
$retval = $_COOKIE[$name];
}
}

return $retval;
Expand Down
8 changes: 4 additions & 4 deletions lib/util/sfFinder.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -580,10 +580,10 @@ protected function exec_ok($dir, $entry)

public static function isPathAbsolute($path)
{
if ($path{0} === '/' || $path{0} === '\\' ||
(strlen($path) > 3 && ctype_alpha($path{0}) &&
$path{1} === ':' &&
($path{2} === '\\' || $path{2} === '/')
if ($path[0] === '/' || $path[0] === '\\' ||
(strlen($path) > 3 && ctype_alpha($path[0]) &&
$path[1] === ':' &&
($path[2] === '\\' || $path[2] === '/')
)
)
{
Expand Down