Skip to content

Commit 60275e4

Browse files
authored
Merge pull request #224 from W0rma/php74
Test PHP 7.3 and 7.4
2 parents d9e3f17 + 2032c83 commit 60275e4

File tree

4 files changed

+40
-12
lines changed

4 files changed

+40
-12
lines changed

.travis.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
language: php
22

33
php:
4-
- 5.5
5-
- 5.6
64
- 7.0
75
- 7.1
86
- 7.2
7+
- 7.3
8+
- 7.4
99
- nightly
1010

1111
# run build against nightly but allow them to fail
@@ -20,6 +20,12 @@ matrix:
2020
- php: 5.4
2121
dist: precise
2222
sudo: required
23+
- php: 5.5
24+
dist: trusty
25+
sudo: required
26+
- php: 5.6
27+
dist: trusty
28+
sudo: required
2329

2430
# faster builds on new travis setup not using sudo
2531
sudo: false

lib/i18n/sfDateFormat.class.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ public function format($time, $pattern = 'F', $inputPattern = null, $charset = '
229229
for ($i = 0, $max = count($tokens); $i < $max; $i++)
230230
{
231231
$pattern = $tokens[$i];
232-
if ($pattern{0} == "'" && $pattern{strlen($pattern) - 1} == "'")
232+
if ($pattern[0] == "'" && $pattern{strlen($pattern) - 1} == "'")
233233
{
234234
$tokens[$i] = str_replace('``````', '\'', preg_replace('/(^\')|(\'$)/', '', $pattern));
235235
}
@@ -266,9 +266,9 @@ public function format($time, $pattern = 'F', $inputPattern = null, $charset = '
266266
*/
267267
protected function getFunctionName($token)
268268
{
269-
if (isset($this->tokens[$token{0}]))
269+
if (isset($this->tokens[$token[0]]))
270270
{
271-
return $this->tokens[$token{0}];
271+
return $this->tokens[$token[0]];
272272
}
273273
}
274274

lib/request/sfWebRequest.class.php

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,14 @@ 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+
if (version_compare(PHP_VERSION, '5.4.0-dev', '<') && get_magic_quotes_gpc())
79+
{
80+
$this->getParameters = sfToolkit::stripslashesDeep($_GET);
81+
}
82+
else
83+
{
84+
$this->getParameters = $_GET;
85+
}
7986
$this->parameterHolder->add($this->getParameters);
8087

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

151-
$this->postParameters = get_magic_quotes_gpc() ? sfToolkit::stripslashesDeep($postParameters) : $postParameters;
158+
if (version_compare(PHP_VERSION, '5.4.0-dev', '<') && get_magic_quotes_gpc())
159+
{
160+
$this->postParameters = sfToolkit::stripslashesDeep($postParameters);
161+
}
162+
else
163+
{
164+
$this->postParameters = $postParameters;
165+
}
166+
152167
$this->parameterHolder->add($this->postParameters);
153168

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

601616
if (isset($_COOKIE[$name]))
602617
{
603-
$retval = get_magic_quotes_gpc() ? sfToolkit::stripslashesDeep($_COOKIE[$name]) : $_COOKIE[$name];
618+
if (version_compare(PHP_VERSION, '5.4.0-dev', '<') && get_magic_quotes_gpc())
619+
{
620+
$retval = sfToolkit::stripslashesDeep($_COOKIE[$name]);
621+
}
622+
else
623+
{
624+
$retval = $_COOKIE[$name];
625+
}
604626
}
605627

606628
return $retval;

lib/util/sfFinder.class.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -580,10 +580,10 @@ protected function exec_ok($dir, $entry)
580580

581581
public static function isPathAbsolute($path)
582582
{
583-
if ($path{0} === '/' || $path{0} === '\\' ||
584-
(strlen($path) > 3 && ctype_alpha($path{0}) &&
585-
$path{1} === ':' &&
586-
($path{2} === '\\' || $path{2} === '/')
583+
if ($path[0] === '/' || $path[0] === '\\' ||
584+
(strlen($path) > 3 && ctype_alpha($path[0]) &&
585+
$path[1] === ':' &&
586+
($path[2] === '\\' || $path[2] === '/')
587587
)
588588
)
589589
{

0 commit comments

Comments
 (0)