Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
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
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![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
------------------
Expand All @@ -7,11 +7,11 @@ This is a community driven fork of symfony 1, as official support has been [inte

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

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.12-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;
}
}
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
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
2 changes: 2 additions & 0 deletions lib/validator/sfValidatorDate.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ protected function doClean($value)
else
{
$dateMax = new DateTime($max);
$dateMax->setTimezone(new DateTimeZone(date_default_timezone_get()));
$max = $dateMax->format('YmdHis');
$maxError = $dateMax->format($this->getOption('date_format_range_error'));
}
Expand All @@ -140,6 +141,7 @@ protected function doClean($value)
else
{
$dateMin = new DateTime($min);
$dateMin->setTimezone(new DateTimeZone(date_default_timezone_get()));
$min = $dateMin->format('YmdHis');
$minError = $dateMin->format($this->getOption('date_format_range_error'));
}
Expand Down
34 changes: 33 additions & 1 deletion test/unit/validator/sfValidatorDateTest.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(52);
$t = new lime_test(56);

$v = new sfValidatorDate();

Expand Down Expand Up @@ -244,3 +244,35 @@
// did it convert from the other timezone to the default timezone?
$date->setTimezone($defaultTimezone);
$t->is($clean, $date->format('Y-m-d H:i:s'), '->clean() respects incoming and default timezones');

// 'min' and 'max' options should be normalized to the default timezone
$v = new sfValidatorDateTime(array(
'min' => '2018-12-06T09:00:00Z'
), array(
'min' => 'min',
));
try
{
$v->clean('2018-12-06T09:59:59+01:00');
$t->fail('->clean() throws an exception if the normalized date is before normalized min-option');
}
catch (sfValidatorError $e)
{
$t->pass('->clean() throws an exception if the normalized date is before normalized min-option');
$t->is($e->getMessage(), 'min', '->clean() adds correct min-message');
}
$v = new sfValidatorDateTime(array(
'max' => '2018-12-06T09:00:00Z'
), array(
'max' => 'max',
));
try
{
$v->clean('2018-12-06T10:00:01+01:00');
$t->fail('->clean() throws an exception if the normalized date is after normalized max-option');
}
catch (sfValidatorError $e)
{
$t->pass('->clean() throws an exception if the normalized date is after normalized max-option');
$t->is($e->getMessage(), 'max', '->clean() adds correct max-message');
}