Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
8e240f0
Allow PATCH as an option in functional tests
mkopinsky Feb 28, 2018
03317bc
Merge pull request #185 from mkopinsky/allow-patch-requests-in-functi…
j0k3r Mar 2, 2018
acbf500
add echoln function to lib/yaml/sfYaml.class.php
antony-develop Mar 2, 2018
ab1d8fa
Merge pull request #187 from antony-develop/patch-1
j0k3r Mar 2, 2018
edc749d
Similar to lexpress/doctrine1#47: Fix case for isSubclassOf method
mkopinsky Mar 7, 2018
2426556
Remove typehint from exception handler
mkopinsky Mar 7, 2018
3e8d073
Merge pull request #189 from mkopinsky/isSubclassOf_CS
j0k3r Mar 9, 2018
db28e96
Merge pull request #188 from mkopinsky/exceptionHandler_typehint
j0k3r Mar 9, 2018
e289cdd
Revert "add echoln function to lib/yaml/sfYaml.class.php"
j0k3r Mar 9, 2018
f60c227
Merge pull request #190 from LExpress/revert-187-patch-1
j0k3r Mar 9, 2018
d2a1886
Fix counting of non-countable versions for PHP 7.2
vitaliytv Mar 10, 2018
93a70fe
Merge pull request #178 from vitaliytv/patch-2
j0k3r Mar 10, 2018
c19e17b
Fix typo
mkopinsky Mar 16, 2018
2dce89d
Merge pull request #191 from mkopinsky/patch-1
j0k3r Mar 17, 2018
40d442b
Prepare 1.5.11
j0k3r Mar 17, 2018
6e3edbf
1.5.12-dev
j0k3r Mar 17, 2018
c811210
"PHP 7.2" instead of "PHP 7.0" in enhacements
robertfausk Mar 22, 2018
31c2460
Merge pull request #192 from robertfausk/patch-1
j0k3r Mar 22, 2018
573d579
Moved to FriendsOfSymfony1
j0k3r Oct 29, 2018
dd75bc4
Update PHPDoc - don't return "Boolean" use bool or false instead
DavidGoodwin Aug 15, 2019
d9e3f17
Merge pull request #211 from DavidGoodwin/patch-2
thePanz Aug 28, 2019
daebc94
Update README.md
callmebob2016 Nov 26, 2019
113be3d
[HttpFoundation] fix guessing mime-types of files with leading dash
Nov 27, 2019
dbe7d74
path need to be placed after the double dash
Nov 27, 2019
1d8ba1d
Test PHP 7.3 and 7.4
W0rma Mar 22, 2020
89421ab
Fix array and string offset access using curly braces (deprecated sin…
W0rma Mar 22, 2020
d6468e1
Call get_magic_quotes_gpc() only for PHP < 5.4 as it always returns f…
W0rma Mar 22, 2020
793f152
Use trusty for PHP 5.5
W0rma Mar 22, 2020
a0dc91d
Use trusty for PHP 5.6 to fix issue with memcache extension
W0rma Mar 22, 2020
2032c83
Call get_magic_quotes_gpc() for PHP < 5.4.0-dev
W0rma Mar 23, 2020
60275e4
Merge pull request #224 from W0rma/php74
j0k3r Apr 2, 2020
d0df47b
Merge pull request #217 from callmebob2016/patch-1
j0k3r Apr 3, 2020
444fb9c
Merge pull request #218 from adrienperonnet/backport-fix-cve-2019-18888
j0k3r Apr 3, 2020
437a29d
1.5.12
j0k3r Apr 3, 2020
7d1bd47
Fix tests count following #218
j0k3r Apr 3, 2020
2b325c0
Merge pull request #225 from FriendsOfSymfony1/fix/following-218
j0k3r Apr 3, 2020
80ff0d2
1.5.13-dev
j0k3r Apr 3, 2020
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
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
CHANGELOG
=========

17/03/2018: Version 1.5.11
--------------------------

* Fix a bug in the lime unit-testing lib #168
* Fix error 'A non well formed numeric value' on sfValidatorFile #181
* Fix usage of octet in recent patch #182
* Allow PATCH as an option in functional tests #185
* Fix case for isSubclassOf method #189
* Remove typehint from exception handler #188
* Fix counting of non-countable var for PHP 7.2 #178

02/08/2017: Version 1.5.10
--------------------------

Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[![Build Status](https://secure.travis-ci.org/LExpress/symfony1.png?branch=master)](http://travis-ci.org/LExpress/symfony1)
[![Build Status](https://secure.travis-ci.org/FriendsOfSymfony1/symfony1.png?branch=master)](http://travis-ci.org/FriendsOfSymfony1/symfony1)

About this version
------------------

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).

**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.**
**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.**

All the enhancements and BC breaks are listed in the [WHATS_NEW](https://github.com/LExpress/symfony1/blob/master/WHATS_NEW.md) file, this include:
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:

- [DIC](https://github.com/LExpress/symfony1/wiki/ServiceContainer)
- [DIC](https://github.com/FriendsOfSymfony1/symfony1/wiki/ServiceContainer)
- Composer support
- PHP 7.0 support
- PHP 7.2 support
- performance boost
- new widgets & validators
- some tickets fixed from the symfony trac
Expand Down Expand Up @@ -51,7 +51,7 @@ Note: On windows, if your project is a few directories down from the drive root,
Option 2: Using Git submodules:

git init # your project
git submodule add https://github.com/LExpress/symfony1.git lib/vendor/symfony
git submodule add https://github.com/FriendsOfSymfony1/symfony1.git lib/vendor/symfony
git submodule update --init --recursive

Documentation
Expand Down
2 changes: 1 addition & 1 deletion lib/autoload/sfCoreAutoload.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* The current symfony version.
*/
define('SYMFONY_VERSION', '1.5.11-dev');
define('SYMFONY_VERSION', '1.5.13-dev');

/**
* sfCoreAutoload class.
Expand Down
6 changes: 5 additions & 1 deletion lib/form/sfFormField.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,10 @@ public function getError()
*/
public function hasError()
{
return null !== $this->error && count($this->error);
if ($this->error instanceof sfValidatorErrorSchema) {
return $this->error->count() > 0;
}

return $this->error !== null;
}
}
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
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public function getPluginModels()
{
$parent = new ReflectionClass('Doctrine_Record');
$reflection = new ReflectionClass($modelName);
if ($reflection->isSubClassOf($parent))
if ($reflection->isSubclassOf($parent))
{
$this->pluginModels[$modelName] = $pluginName;

Expand Down
4 changes: 2 additions & 2 deletions lib/request/sfRequest.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public function setMethod($method)
*
* @param string $name The name of the request parameter
*
* @return Boolean true if the request parameter exists, false otherwise
* @return bool true if the request parameter exists, false otherwise
*/
public function offsetExists($name)
{
Expand Down Expand Up @@ -308,7 +308,7 @@ public function setParameter($name, $value)
/**
* Returns the content of the current request.
*
* @return string|Boolean The content or false if none is available
* @return string|false The content or false if none is available
*/
public function getContent()
{
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
2 changes: 1 addition & 1 deletion lib/response/sfWebResponse.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
/**
* sfWebResponse class.
*
* This class manages web reponses. It supports cookies and headers management.
* This class manages web responses. It supports cookies and headers management.
*
* @package symfony
* @subpackage response
Expand Down
2 changes: 1 addition & 1 deletion lib/test/sfTestFunctionalBase.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ static public function handlePhpError($errno, $errstr, $errfile, $errline)
*
* @param Exception $exception The exception
*/
function handleException(Exception $exception)
function handleException($exception)
{
$this->test()->error(sprintf('%s: %s', get_class($exception), $exception->getMessage()));

Expand Down
2 changes: 1 addition & 1 deletion lib/util/sfBrowserBase.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ public function call($uri, $method = 'get', $parameters = array(), $changeStack

// request parameters
$_GET = $_POST = array();
if (in_array(strtoupper($method), array('POST', 'DELETE', 'PUT')))
if (in_array(strtoupper($method), array('POST', 'DELETE', 'PUT', 'PATCH')))
{
if (isset($parameters['_with_csrf']) && $parameters['_with_csrf'])
{
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
4 changes: 3 additions & 1 deletion lib/validator/sfValidatorFile.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,9 @@ protected function guessFromFileBinary($file)
{
ob_start();
//need to use --mime instead of -i. see #6641
passthru(sprintf('file -b --mime %s 2>/dev/null', escapeshellarg($file)), $return);
$cmd = 'file -b --mime -- %s 2>/dev/null';
$file = (0 === strpos($file, '-') ? './' : '').$file;
passthru(sprintf($cmd, escapeshellarg($file)), $return);
if ($return > 0)
{
ob_end_clean();
Expand Down
3 changes: 2 additions & 1 deletion test/unit/validator/sfValidatorFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

require_once(__DIR__.'/../../bootstrap/unit.php');

$t = new lime_test(69);
$t = new lime_test(70);

$tmpDir = sys_get_temp_dir();
$content = 'This is an ASCII file.';
Expand Down Expand Up @@ -106,6 +106,7 @@ public function getMimeTypesFromCategory($category)
$t->is($v->guessFromFileBinary($tmpDir.'/test.txt'), 'text/plain', '->guessFromFileBinary() guesses the type of a given file');
$t->is($v->guessFromFileBinary($tmpDir.'/foo.txt'), null, '->guessFromFileBinary() returns null if the file type is not guessable');
$t->is($v->guessFromFileBinary('/bin/ls'), (PHP_OS != 'Darwin') ? 'application/x-executable' : 'application/octet-stream', '->guessFromFileBinary() returns correct type if file is guessable');
$t->is($v->guessFromFileBinary('-test'), null, '->guessFromFileBinary() returns null if file path has leading dash');

// ->getMimeType()
$t->diag('->getMimeType()');
Expand Down