From 8e240f015cb03ec50751f77d0e75374203c7039f Mon Sep 17 00:00:00 2001 From: Michael Kopinsky Date: Wed, 28 Feb 2018 17:39:02 -0500 Subject: [PATCH 01/12] Allow PATCH as an option in functional tests --- lib/util/sfBrowserBase.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util/sfBrowserBase.class.php b/lib/util/sfBrowserBase.class.php index 21c5cbc1d..21d3de7da 100755 --- a/lib/util/sfBrowserBase.class.php +++ b/lib/util/sfBrowserBase.class.php @@ -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']) { From acbf5002676b41d825051ba0466c7e6f7b49d015 Mon Sep 17 00:00:00 2001 From: antony-develop <19634898+antony-develop@users.noreply.github.com> Date: Fri, 2 Mar 2018 19:24:58 +1000 Subject: [PATCH 02/12] add echoln function to lib/yaml/sfYaml.class.php --- lib/yaml/sfYaml.class.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/yaml/sfYaml.class.php b/lib/yaml/sfYaml.class.php index 80085856c..6fb124516 100644 --- a/lib/yaml/sfYaml.class.php +++ b/lib/yaml/sfYaml.class.php @@ -165,3 +165,13 @@ protected static function arrayConvertEncoding(array $result, $encoding) return $convertedResult; } } + +/** + * Wraps echo to automatically provide a newline. + * + * @param string $string The string to echo with new line + */ +function echoln($string) +{ + echo $string."\n"; +} From edc749d4b3e43baa46104e81aa03ce0ed75526d8 Mon Sep 17 00:00:00 2001 From: Michael Kopinsky Date: Wed, 7 Mar 2018 14:52:36 -0500 Subject: [PATCH 03/12] Similar to lexpress/doctrine1#47: Fix case for isSubclassOf method --- .../lib/generator/sfDoctrineFormGenerator.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/plugins/sfDoctrinePlugin/lib/generator/sfDoctrineFormGenerator.class.php b/lib/plugins/sfDoctrinePlugin/lib/generator/sfDoctrineFormGenerator.class.php index ab372889b..10690bb95 100644 --- a/lib/plugins/sfDoctrinePlugin/lib/generator/sfDoctrineFormGenerator.class.php +++ b/lib/plugins/sfDoctrinePlugin/lib/generator/sfDoctrineFormGenerator.class.php @@ -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; From 2426556127c77da31808275497822d3b102b040a Mon Sep 17 00:00:00 2001 From: Michael Kopinsky Date: Wed, 7 Mar 2018 14:54:06 -0500 Subject: [PATCH 04/12] Remove typehint from exception handler This exception handler can be passed Exceptions as well as Errors. In PHP7 those both fall under the parent class 'Throwable', but for PHP5 BC it's advised to just remove the typehint entirely --- lib/test/sfTestFunctionalBase.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/test/sfTestFunctionalBase.class.php b/lib/test/sfTestFunctionalBase.class.php index 47d032a0c..2f3da782c 100644 --- a/lib/test/sfTestFunctionalBase.class.php +++ b/lib/test/sfTestFunctionalBase.class.php @@ -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())); From e289cddec24d016c0ef3b5684c27ade9d51e5b12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Benoist?= Date: Fri, 9 Mar 2018 09:33:13 +0100 Subject: [PATCH 05/12] Revert "add echoln function to lib/yaml/sfYaml.class.php" --- lib/yaml/sfYaml.class.php | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/lib/yaml/sfYaml.class.php b/lib/yaml/sfYaml.class.php index 6fb124516..80085856c 100644 --- a/lib/yaml/sfYaml.class.php +++ b/lib/yaml/sfYaml.class.php @@ -165,13 +165,3 @@ protected static function arrayConvertEncoding(array $result, $encoding) return $convertedResult; } } - -/** - * Wraps echo to automatically provide a newline. - * - * @param string $string The string to echo with new line - */ -function echoln($string) -{ - echo $string."\n"; -} From d2a188676e7641f40839a7a65bf84677bcc3845a Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 10 Mar 2018 12:56:31 +0200 Subject: [PATCH 06/12] Fix counting of non-countable versions for PHP 7.2 Update sfFormField.class.php Update sfFormField.class.php remove null !== $this->error fix by e1himself Update sfFormField.class.php test travis --- lib/form/sfFormField.class.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/form/sfFormField.class.php b/lib/form/sfFormField.class.php index 076ccaa1f..81b378fde 100644 --- a/lib/form/sfFormField.class.php +++ b/lib/form/sfFormField.class.php @@ -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; } } From c19e17bd7dcbf21469a93123a3426077a2250494 Mon Sep 17 00:00:00 2001 From: Michael Kopinsky Date: Fri, 16 Mar 2018 16:47:06 -0400 Subject: [PATCH 07/12] Fix typo --- lib/response/sfWebResponse.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/response/sfWebResponse.class.php b/lib/response/sfWebResponse.class.php index 343c88fee..4a9a6585a 100644 --- a/lib/response/sfWebResponse.class.php +++ b/lib/response/sfWebResponse.class.php @@ -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 From 40d442b3ed23fa32684d6a34962c738226a3b9b4 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 17 Mar 2018 13:21:51 +0100 Subject: [PATCH 08/12] Prepare 1.5.11 --- CHANGELOG.md | 11 +++++++++++ lib/autoload/sfCoreAutoload.class.php | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4613a05e0..022e5a39e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 -------------------------- diff --git a/lib/autoload/sfCoreAutoload.class.php b/lib/autoload/sfCoreAutoload.class.php index 8102ee311..c93ce4324 100755 --- a/lib/autoload/sfCoreAutoload.class.php +++ b/lib/autoload/sfCoreAutoload.class.php @@ -11,7 +11,7 @@ /** * The current symfony version. */ -define('SYMFONY_VERSION', '1.5.11-dev'); +define('SYMFONY_VERSION', '1.5.11'); /** * sfCoreAutoload class. From 6e3edbf9c9394679b707585da08356416bfeb190 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 17 Mar 2018 13:25:00 +0100 Subject: [PATCH 09/12] 1.5.12-dev --- lib/autoload/sfCoreAutoload.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/autoload/sfCoreAutoload.class.php b/lib/autoload/sfCoreAutoload.class.php index c93ce4324..d16a0310b 100755 --- a/lib/autoload/sfCoreAutoload.class.php +++ b/lib/autoload/sfCoreAutoload.class.php @@ -11,7 +11,7 @@ /** * The current symfony version. */ -define('SYMFONY_VERSION', '1.5.11'); +define('SYMFONY_VERSION', '1.5.12-dev'); /** * sfCoreAutoload class. From c81121076f063bfbc1ab6109085fc08e240e99fc Mon Sep 17 00:00:00 2001 From: Robert Freigang Date: Thu, 22 Mar 2018 11:05:27 +0100 Subject: [PATCH 10/12] "PHP 7.2" instead of "PHP 7.0" in enhacements --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2dabd7472..8077e2a64 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ All the enhancements and BC breaks are listed in the [WHATS_NEW](https://github. - [DIC](https://github.com/LExpress/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 From 573d5790cb007ff8a4447a148497a5516673fcea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Benoist?= Date: Mon, 29 Oct 2018 16:34:55 +0100 Subject: [PATCH 11/12] Moved to FriendsOfSymfony1 --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 8077e2a64..ff1d95810 100644 --- a/README.md +++ b/README.md @@ -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 ------------------ @@ -7,9 +7,9 @@ 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.2 support - performance boost @@ -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 From bc37527a7fb91b2f66e398b0499f01c305c3448b Mon Sep 17 00:00:00 2001 From: Dirk Nederveen Date: Thu, 6 Dec 2018 09:33:32 +0100 Subject: [PATCH 12/12] Normalize min/max-options for sfValidatorDateTime --- lib/validator/sfValidatorDate.class.php | 2 ++ test/unit/validator/sfValidatorDateTest.php | 34 ++++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/lib/validator/sfValidatorDate.class.php b/lib/validator/sfValidatorDate.class.php index 1b03cb6f8..ee9343c17 100644 --- a/lib/validator/sfValidatorDate.class.php +++ b/lib/validator/sfValidatorDate.class.php @@ -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')); } @@ -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')); } diff --git a/test/unit/validator/sfValidatorDateTest.php b/test/unit/validator/sfValidatorDateTest.php index e695bb792..37626bd38 100644 --- a/test/unit/validator/sfValidatorDateTest.php +++ b/test/unit/validator/sfValidatorDateTest.php @@ -10,7 +10,7 @@ require_once(__DIR__.'/../../bootstrap/unit.php'); -$t = new lime_test(52); +$t = new lime_test(56); $v = new sfValidatorDate(); @@ -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'); +}