From 74fc18238a69ddba70d491d36578533acb91b223 Mon Sep 17 00:00:00 2001 From: 4alexandr <4alexandr.n@gmail.com> Date: Fri, 23 Jan 2015 17:47:29 +0200 Subject: [PATCH 1/6] Made PATTERN_MATCH_ID_METHOD more flexible PATTERN_MATCH_ID_METHOD match any valid function declaration, example: function getId(){return$this->id;} --- lib/Doctrine/Common/Proxy/ProxyGenerator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/Common/Proxy/ProxyGenerator.php b/lib/Doctrine/Common/Proxy/ProxyGenerator.php index e51600844..404f77123 100644 --- a/lib/Doctrine/Common/Proxy/ProxyGenerator.php +++ b/lib/Doctrine/Common/Proxy/ProxyGenerator.php @@ -37,7 +37,7 @@ class ProxyGenerator * Used to match very simple id methods that don't need * to be decorated since the identifier is known. */ - const PATTERN_MATCH_ID_METHOD = '((public\s)?(function\s{1,}%s\s?\(\)\s{1,})\s{0,}{\s{0,}return\s{0,}\$this->%s;\s{0,}})i'; + const PATTERN_MATCH_ID_METHOD = '((public\s+)?(function\s+%s\s*\(\)\s*)\s*{\s*return\s*\$this->%s;\s*})i'; /** * The namespace that contains all proxy classes. From 18217c34e7c552ab739b8e0d22a041b880e1b503 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Pr=C3=A9vot?= Date: Thu, 26 Mar 2015 22:15:02 -0400 Subject: [PATCH 2/6] Fix static call in test Two tests were failing with the following error message: Non-static method PHPUnit_Framework_MockObject_Generator::getMock() should not be called statically, assuming $this from incompatible context Bug: http://www.doctrine-project.org/jira/browse/DCOM-281 Forwarded: https://github.com/doctrine/common/pull/361 --- .../Tests/Common/Persistence/ManagerRegistryTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/Doctrine/Tests/Common/Persistence/ManagerRegistryTest.php b/tests/Doctrine/Tests/Common/Persistence/ManagerRegistryTest.php index 40dec77e5..7c9329091 100644 --- a/tests/Doctrine/Tests/Common/Persistence/ManagerRegistryTest.php +++ b/tests/Doctrine/Tests/Common/Persistence/ManagerRegistryTest.php @@ -2,10 +2,10 @@ namespace Doctrine\Tests\Common\Persistence; -use \PHPUnit_Framework_MockObject_Generator; use Doctrine\Common\Persistence\AbstractManagerRegistry; use Doctrine\Tests\Common\Persistence\Mapping\TestClassMetadataFactory; use Doctrine\Tests\DoctrineTestCase; +use PHPUnit_Framework_TestCase; /** * @groups DCOM-270 @@ -64,12 +64,12 @@ public function testGetManagerForInvalidAliasedClass() } } -class TestManager +class TestManager extends PHPUnit_Framework_TestCase { public function getMetadataFactory() { - $driver = PHPUnit_Framework_MockObject_Generator::getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); - $metadata = PHPUnit_Framework_MockObject_Generator::getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); + $driver = $this->getMock('Doctrine\Common\Persistence\Mapping\Driver\MappingDriver'); + $metadata = $this->getMock('Doctrine\Common\Persistence\Mapping\ClassMetadata'); return new TestClassMetadataFactory($driver, $metadata); } From b950908c32ff43105f6b08124ae7644868dd682f Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Thu, 2 Apr 2015 21:03:39 +0100 Subject: [PATCH 3/6] Bumping version to 2.6.0-DEV --- lib/Doctrine/Common/Version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/Common/Version.php b/lib/Doctrine/Common/Version.php index bc9e2bdde..80c1fbf76 100644 --- a/lib/Doctrine/Common/Version.php +++ b/lib/Doctrine/Common/Version.php @@ -34,7 +34,7 @@ class Version /** * Current Doctrine Version. */ - const VERSION = '2.5.0-DEV'; + const VERSION = '2.6.0-DEV'; /** * Compares a Doctrine version with the current one. From 9b30b437a52b74979b9cf58405f8bf88337e81c2 Mon Sep 17 00:00:00 2001 From: marcel-burkhard Date: Tue, 28 Apr 2015 22:31:49 +0200 Subject: [PATCH 4/6] Update DefaultFileLocator.php It is implicit that a file extension needs a dot, thus it is unclear that we need to supply it in $fileExtension. I actually wasted quite some time trying to figure out what I'm doing wrong. --- .../Common/Persistence/Mapping/Driver/DefaultFileLocator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php b/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php index 6a9e27647..58a740b57 100644 --- a/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php +++ b/lib/Doctrine/Common/Persistence/Mapping/Driver/DefaultFileLocator.php @@ -51,7 +51,7 @@ class DefaultFileLocator implements FileLocator * documents and operates in the specified operating mode. * * @param string|array $paths One or multiple paths where mapping documents can be found. - * @param string|null $fileExtension The file extension of mapping documents. + * @param string|null $fileExtension The file extension of mapping documents, usually prefixed with a dot. */ public function __construct($paths, $fileExtension = null) { From ff72726b0876638fa7db2f28b0f26e3f1f6656ca Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Wed, 13 May 2015 15:35:24 +0200 Subject: [PATCH 5/6] Remove the hhvm-nightly job from the matrix hhvm-nightly is not available anymore on Travis for now, because HHVM dropped support for Ubuntu 10.04. This also switches to the new Travis infrastructure --- .travis.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3ecfa10e7..9c20a84b4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,11 @@ language: php +sudo: false + +cache: + directory: + - $HOME/.composer/cache + php: - 5.3.3 - 5.3 @@ -8,7 +14,6 @@ php: - 5.6 - 7.0 - hhvm - - hhvm-nightly before_script: - composer --prefer-source install @@ -19,4 +24,3 @@ script: matrix: allow_failures: - php: 7.0 - - php: hhvm-nightly From b3ae747e4e63d8785b745762830850160eac2ab4 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Mon, 31 Aug 2015 14:20:35 +0200 Subject: [PATCH 6/6] [DCOM-293] Fix security misconfiguration vulnerability that can lead to local arbitrary code execution. --- lib/Doctrine/Common/Proxy/ProxyGenerator.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Doctrine/Common/Proxy/ProxyGenerator.php b/lib/Doctrine/Common/Proxy/ProxyGenerator.php index 4c5a239a4..3941f17e4 100644 --- a/lib/Doctrine/Common/Proxy/ProxyGenerator.php +++ b/lib/Doctrine/Common/Proxy/ProxyGenerator.php @@ -302,6 +302,7 @@ public function generateProxyClass(ClassMetadata $class, $fileName = false) $tmpFileName = $fileName . '.' . uniqid('', true); file_put_contents($tmpFileName, $proxyCode); + chmod($tmpFileName, 0664); rename($tmpFileName, $fileName); }