Skip to content

Commit b220b1e

Browse files
committed
1.15.3 übernommen.
2 parents 988a769 + 28fa682 commit b220b1e

18 files changed

+99
-60
lines changed

.travis.yml

+14-16
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,45 @@
1+
os: linux
2+
dist: xenial
13
language: php
24

35
php:
4-
- 5.5
5-
- 5.6
66
- 7.0
77
- 7.1
88
- 7.2
9+
- 7.3
10+
- 7.4
911
- nightly
1012

1113
# run build against nightly but allow them to fail
12-
matrix:
14+
jobs:
1315
fast_finish: true
1416
allow_failures:
1517
- php: nightly
1618
include:
1719
- php: 5.3
1820
dist: precise
19-
sudo: required
2021
- php: 5.4
2122
dist: precise
22-
sudo: required
23-
24-
# faster builds on new travis setup not using sudo
25-
sudo: false
23+
- php: 5.5
24+
dist: trusty
25+
- php: 5.6
26+
dist: trusty
2627

2728
services:
2829
- memcached
2930

30-
# cache vendor dirs
3131
cache:
3232
directories:
33-
- lib/vendor/swiftmailer
3433
- $HOME/.composer/cache
3534

36-
install:
37-
- composer self-update
35+
before_install:
36+
- sh -c 'if [ $(php -r "echo PHP_MINOR_VERSION;") -le 4 ] && [ $(php -r "echo PHP_MAJOR_VERSION;") -le 5 ]; then echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;'
37+
- sh -c 'if [ $(php -r "echo PHP_RELEASE_VERSION;") -le 98 ] && [ $(php -r "echo PHP_MAJOR_VERSION;") -le 5 ]; then echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;'
3838

39-
before_script:
39+
install:
4040
# by default, --remote is not used on travis
4141
- git submodule update --remote --force
42-
- sh -c 'if [ $(php -r "echo PHP_MINOR_VERSION;") -le 4 ] && [ $(php -r "echo PHP_MAJOR_VERSION;") -le 5 ]; then echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;'
43-
- sh -c 'if [ $(php -r "echo PHP_RELEASE_VERSION;") -le 98 ] && [ $(php -r "echo PHP_MAJOR_VERSION;") -le 5 ]; then echo "extension = memcache.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;'
44-
- composer install
42+
- composer install --prefer-dist --no-progress --no-suggest -o
4543

4644
script:
4745
- php data/bin/check_configuration.php

CHANGELOG.md

+16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
CHANGELOG
22
=========
33

4+
08/06/2020: Version 1.5.13
5+
--------------------------
6+
7+
* Fix for `Warning: ini_set(): A session is active...` #229
8+
* Php 7.4 Incompatibility Fixes #228
9+
* Remove notice appeared on php 7.4 #230
10+
* Rename package to `friendsofsymfony1/symfony1` #231
11+
12+
03/04/2020: Version 1.5.12
13+
--------------------------
14+
15+
* Move project from @LExpress to @FriendsOfSymfony1
16+
* Some doc & readme update
17+
* Fixes for PHP 7.3 & 7.4 (thanks @W0rma for the code and @alquerci for the review) #224
18+
* Backport fix for cve-2019-18888 by @adrienperonnet #218
19+
420
17/03/2018: Version 1.5.11
521
--------------------------
622

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ About this version
55

66
This is a community driven fork of symfony 1, as official support has been [interrupted in November 2012](http://symfony.com/blog/symfony-1-4-end-of-maintenance-what-does-it-mean).
77

8-
**Do not use it for new projects: this version is great to improve existing symfony1 applications, but [Symfony4](http://symfony.com/) is the way to go today.**
8+
**Do not use it for new projects: this version is great to improve existing symfony1 applications, but [Symfony5](http://symfony.com/) is the way to go today.**
99

1010
All the enhancements and BC breaks are listed in the [WHATS_NEW](https://github.com/FriendsOfSymfony1/symfony1/blob/master/WHATS_NEW.md) file, this include:
1111

@@ -29,7 +29,7 @@ The end result of these advantages means there is no need to reinvent the wheel
2929
Symfony was written entirely in PHP 5.
3030
It has been thoroughly tested in various real-world projects, and is actually in use for high-demand e-business websites.
3131
It is compatible with most of the available databases engines, including MySQL, PostgreSQL, Oracle, and Microsoft SQL Server.
32-
It runs on *nix and Windows platforms.
32+
It runs on *nix and Windows platforms*.
3333

3434
Requirements
3535
------------

composer.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
{
2-
"name": "lexpress/symfony1",
2+
"name": "friendsofsymfony1/symfony1",
33
"description": "Fork of symfony 1.4 with dic, form enhancements, latest swiftmailer and better performance",
4+
"type": "library",
45
"license": "MIT",
56
"require": {
7+
"php" : ">=5.3.0",
68
"swiftmailer/swiftmailer": "~5.2|~6.0"
79
},
810
"require-dev": {
911
"psr/log": "*"
1012
},
11-
"type": "library",
1213
"autoload": {
1314
"files": ["autoload.php"]
1415
},
1516
"suggest": {
16-
"lexpress/doctrine1": "Doctrine plugin",
17+
"friendsofsymfony1/doctrine1": "Doctrine plugin",
1718
"propel/sf-propel-o-r-m-plugin": "Propel plugin",
1819
"psr/log": "Psr logger"
1920
},

lib/autoload/sfCoreAutoload.class.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/**
1212
* The current symfony version.
1313
*/
14-
define('SYMFONY_VERSION', '1.5.12-dev');
14+
define('SYMFONY_VERSION', '1.5.13');
1515

1616
/**
1717
* sfCoreAutoload class.

lib/config/sfFactoryConfigHandler.class.php

+4
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@ public function execute($configFiles)
109109
unset($parameters['database']);
110110
}
111111

112+
if (isset($config['user']['param']['timeout'])) {
113+
$defaultParameters[] = sprintf("'gc_maxlifetime' => %d,", $config['user']['param']['timeout']);
114+
}
115+
112116
$instances[] = sprintf(" \$class = sfConfig::get('sf_factory_storage', '%s');\n \$this->factories['storage'] = new \$class(array_merge(array(\n%s\n), sfConfig::get('sf_factory_storage_parameters', %s)));", $class, implode("\n", $defaultParameters), var_export($parameters, true));
113117
break;
114118

lib/form/sfForm.class.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ class sfForm implements ArrayAccess, Iterator, Countable
6363
*/
6464
public function __construct($defaults = array(), $options = array(), $CSRFSecret = null)
6565
{
66-
$this->setDefaults($defaults);
6766
$this->options = $options;
6867
$this->localCSRFSecret = $CSRFSecret;
6968

7069
$this->validatorSchema = new sfValidatorSchema();
7170
$this->widgetSchema = new sfWidgetFormSchema();
7271
$this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);
7372

73+
$this->setDefaults($defaults);
7474
$this->setup();
7575
$this->configure();
7676

lib/helper/UrlHelper.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ function _encodeText($text)
630630

631631
for ($i = 0; $i < strlen($text); $i++)
632632
{
633-
$char = $text{$i};
633+
$char = $text[$i];
634634
$r = mt_rand(0, 100);
635635

636636
# roughly 10% raw, 45% hex, 45% dec

lib/i18n/sfDateFormat.class.php

+10-10
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

@@ -397,30 +397,30 @@ protected function getTokens($pattern)
397397

398398
for ($i = 0, $max = strlen($pattern); $i < $max; $i++)
399399
{
400-
if ($char == null || $pattern{$i} == $char || $text)
400+
if ($char == null || $pattern[$i] == $char || $text)
401401
{
402-
$token .= $pattern{$i};
402+
$token .= $pattern[$i];
403403
}
404404
else
405405
{
406406
$tokens[] = str_replace("''", "'", $token);
407-
$token = $pattern{$i};
407+
$token = $pattern[$i];
408408
}
409409

410-
if ($pattern{$i} == "'" && $text == false)
410+
if ($pattern[$i] == "'" && $text == false)
411411
{
412412
$text = true;
413413
}
414-
else if ($text && $pattern{$i} == "'" && $char == "'")
414+
else if ($text && $pattern[$i] == "'" && $char == "'")
415415
{
416416
$text = true;
417417
}
418-
else if ($text && $char != "'" && $pattern{$i} == "'")
418+
else if ($text && $char != "'" && $pattern[$i] == "'")
419419
{
420420
$text = false;
421421
}
422422

423-
$char = $pattern{$i};
423+
$char = $pattern[$i];
424424

425425
}
426426
$tokens[] = $token;

lib/i18n/sfNumberFormat.class.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ protected function formatInteger($string)
193193
// now for the integer groupings
194194
for ($i = 0; $i < $len; $i++)
195195
{
196-
$char = $string{$len - $i - 1};
196+
$char = $string[$len - $i - 1];
197197

198198
if ($multiGroup && $count == 0)
199199
{

lib/i18n/sfNumberFormatInfo.class.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ protected function parsePattern($pattern)
316316
// to find the groupsize 1.
317317
for ($i = strlen($pattern) - 1; $i >= 0; $i--)
318318
{
319-
if ($pattern{$i} == $digit || $pattern{$i} == $hash)
319+
if ($pattern[$i] == $digit || $pattern[$i] == $hash)
320320
{
321321
$groupSize1 = $i - $groupPos1;
322322
break;
@@ -335,11 +335,11 @@ protected function parsePattern($pattern)
335335
{
336336
for ($i = strlen($pattern) - 1; $i >= 0; $i--)
337337
{
338-
if ($pattern{$i} == $dot)
338+
if ($pattern[$i] == $dot)
339339
{
340340
break;
341341
}
342-
if ($pattern{$i} == $digit)
342+
if ($pattern[$i] == $digit)
343343
{
344344
$decimalPoints = $i - $decimalPos;
345345
break;

lib/request/sfRequest.class.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ public function setMethod($method)
171171
*
172172
* @param string $name The name of the request parameter
173173
*
174-
* @return Boolean true if the request parameter exists, false otherwise
174+
* @return bool true if the request parameter exists, false otherwise
175175
*/
176176
public function offsetExists($name)
177177
{
@@ -308,7 +308,7 @@ public function setParameter($name, $value)
308308
/**
309309
* Returns the content of the current request.
310310
*
311-
* @return string|Boolean The content or false if none is available
311+
* @return string|false The content or false if none is available
312312
*/
313313
public function getContent()
314314
{

lib/request/sfWebRequest.class.php

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

7777
// GET parameters
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;
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+
}
8186
$this->parameterHolder->add($this->getParameters);
8287

8388
$postParameters = $_POST;
@@ -150,9 +155,15 @@ public function initialize(sfEventDispatcher $dispatcher, $parameters = array(),
150155
$this->setMethod(self::GET);
151156
}
152157

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;
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+
156167
$this->parameterHolder->add($this->postParameters);
157168

158169
if ($formats = $this->getOption('formats'))
@@ -604,9 +615,14 @@ public function getCookie($name, $defaultValue = null)
604615

605616
if (isset($_COOKIE[$name]))
606617
{
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];
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+
}
610626
}
611627

612628
return $retval;

lib/storage/sfSessionStorage.class.php

+7
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public function initialize($options = null)
6363
'session_cookie_secure' => $cookieDefaults['secure'],
6464
'session_cookie_httponly' => isset($cookieDefaults['httponly']) ? $cookieDefaults['httponly'] : false,
6565
'session_cache_limiter' => null,
66+
'gc_maxlifetime' => 1800,
6667
), $options);
6768

6869
// initialize parent
@@ -90,6 +91,12 @@ public function initialize($options = null)
9091
session_cache_limiter($this->options['session_cache_limiter']);
9192
}
9293

94+
// force the max lifetime for session garbage collector to be greater than timeout
95+
if (ini_get('session.gc_maxlifetime') < $this->options['gc_maxlifetime'])
96+
{
97+
ini_set('session.gc_maxlifetime', $this->options['gc_maxlifetime']);
98+
}
99+
93100
if ($this->options['auto_start'] && !self::$sessionStarted)
94101
{
95102
session_start();

lib/user/sfBasicSecurityUser.class.php

+2-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This file is part of the symfony package.
55
* (c) 2004-2006 Fabien Potencier <[email protected]>
66
* (c) 2004-2006 Sean Kerr <[email protected]>
7-
*
7+
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
1010
*/
@@ -42,7 +42,7 @@ public function clearCredentials()
4242

4343
/**
4444
* Returns the current user's credentials.
45-
*
45+
*
4646
* @return array
4747
*/
4848
public function getCredentials()
@@ -251,12 +251,6 @@ public function initialize(sfEventDispatcher $dispatcher, sfStorage $storage, $o
251251
$this->options['timeout'] = 1800;
252252
}
253253

254-
// force the max lifetime for session garbage collector to be greater than timeout
255-
if (ini_get('session.gc_maxlifetime') < $this->options['timeout'])
256-
{
257-
ini_set('session.gc_maxlifetime', $this->options['timeout']);
258-
}
259-
260254
// read data from storage
261255
$this->authenticated = $storage->read(self::AUTH_NAMESPACE);
262256
$this->credentials = $storage->read(self::CREDENTIAL_NAMESPACE);

lib/validator/sfValidatorFile.class.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,9 @@ protected function guessFromFileBinary($file)
263263
{
264264
ob_start();
265265
//need to use --mime instead of -i. see #6641
266-
passthru(sprintf('file -b --mime %s 2>/dev/null', escapeshellarg($file)), $return);
266+
$cmd = 'file -b --mime -- %s 2>/dev/null';
267+
$file = (0 === strpos($file, '-') ? './' : '').$file;
268+
passthru(sprintf($cmd, escapeshellarg($file)), $return);
267269
if ($return > 0)
268270
{
269271
ob_end_clean();

0 commit comments

Comments
 (0)