From dbfea6d0fa8842f6e786d54bbae8d65e5ebe849c Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Fri, 14 Aug 2015 15:52:13 +0200 Subject: [PATCH 1/5] [ticket/14099] Update composer.phar PHPBB3-14099 --- composer.phar | Bin 1075150 -> 1075373 bytes 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 composer.phar diff --git a/composer.phar b/composer.phar old mode 100755 new mode 100644 index 3481b599b75631b0d91e0806612f090391cb6b4e..a3bd28e4f4bba88d50989f74a84d25d49e06bc07 GIT binary patch delta 4816 zcma)9c~p~E7XOqbAqfz+Kn%+lc9bPy-vR_=mwhMa6L^4i62<2l`1b(3G)yugyhDEklYv)aonU*5{idrg?^~X?8b4g zlqUy2@GZ}cd|T#5r}wyNP}{T{Y1t6KaeMC!PQV36Fcl&N3UrIe{9y;)5EY_@XXkL- zQ;%+qM6-G^`TCHUw4M+XWwYXZ6uuzfIKPRL52HK0L=1fr8EPMrkl_20Qe4k-Cr0${ zCAdE1UW^L1Gi#lp`BqdgBauM32U*PaAO#yev?$mvD?q!;% z;mQv9Ng;HJHA2luYqM)Als>1aTUImCb-bIL;y%!;#^DaaT_9;g+`;dX-KIG9| z$2!lK_J8Y3u}*t)+_xiNy#i8M6!iIuK;kDvkEUEW?oxznH6uX|$9%n@%+DV;zIW%i z9T)3wfyV-Jb;OUyjptYl3AZ=oz!9%-==K)D6+dD}AR}KE$tV%KJXlR%eCrcf98MbE zkVT-=S7bzEs{dkKKkiQlexJi}UwrK`2QCE4;j~-|56eX$4UnKvNWfw=A0gv7*REV( z)fWzX0s?UJwE)u4%i1XL>2yEGrVFIWeNdo6u0woQUV(UBPCTa0D@U!VjD~olNr};( zmIo?S)dqcs!5ZJ!+4nkY5PK8b(Yf-GE9hREw;zZVUZ^ZYLFAhhMX0RUiQ}$0XLiH! zI634gh47hzvV2=XC94UfEDr}#md^zeA<7`y?+hYuPXv{r!kSQyn>iSi4Q*MZP!;Tf zmbJk|`KDlMroR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{8~H=Cm^!XD|^?Md%H^{FfxySCY4F&JzbW0S$Ib+lOYI-|*9Y|`1xMu%?f zxop|5GkzB~vgV5!eq$4JWzjCbkM+)z?fgTifU&RhWN(Kl5B?KMk>7 Date: Fri, 14 Aug 2015 15:52:24 +0200 Subject: [PATCH 2/5] [ticket/14099] Update twig/twig to 1.20.0 PHPBB3-14099 --- phpBB/composer.json | 2 +- phpBB/composer.lock | 48 ++++++++++++++++++++++++++------------------- 2 files changed, 29 insertions(+), 21 deletions(-) diff --git a/phpBB/composer.json b/phpBB/composer.json index f2564de0f5..af1cd2b329 100644 --- a/phpBB/composer.json +++ b/phpBB/composer.json @@ -34,7 +34,7 @@ "symfony/http-kernel": "2.3.*", "symfony/routing": "2.3.*", "symfony/yaml": "2.3.*", - "twig/twig": "1.13.*" + "twig/twig": "1.*" }, "require-dev": { "fabpot/goutte": "1.0.*", diff --git a/phpBB/composer.lock b/phpBB/composer.lock index 4a034bbdf8..dffa51704f 100644 --- a/phpBB/composer.lock +++ b/phpBB/composer.lock @@ -4,7 +4,7 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "17b51553237b78392baf2ec78bfdfbc0", + "hash": "5864f5064e1ca81dd9817ee2674b5dfd", "packages": [ { "name": "lusitanian/oauth", @@ -650,25 +650,25 @@ }, { "name": "twig/twig", - "version": "v1.13.2", + "version": "v1.20.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "6d6a1009427d1f398c9d40904147bf9f723d5755" + "reference": "1ea4e5f81c6d005fe84d0b38e1c4f1955eb86844" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/6d6a1009427d1f398c9d40904147bf9f723d5755", - "reference": "6d6a1009427d1f398c9d40904147bf9f723d5755", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/1ea4e5f81c6d005fe84d0b38e1c4f1955eb86844", + "reference": "1ea4e5f81c6d005fe84d0b38e1c4f1955eb86844", "shasum": "" }, "require": { - "php": ">=5.2.4" + "php": ">=5.2.7" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.13-dev" + "dev-master": "1.20-dev" } }, "autoload": { @@ -683,11 +683,19 @@ "authors": [ { "name": "Fabien Potencier", - "email": "fabien@symfony.com" + "email": "fabien@symfony.com", + "homepage": "http://fabien.potencier.org", + "role": "Lead Developer" }, { "name": "Armin Ronacher", - "email": "armin.ronacher@active-4.com" + "email": "armin.ronacher@active-4.com", + "role": "Project Founder" + }, + { + "name": "Twig Team", + "homepage": "http://twig.sensiolabs.org/contributors", + "role": "Contributors" } ], "description": "Twig, the flexible, fast, and secure template language for PHP", @@ -695,7 +703,7 @@ "keywords": [ "templating" ], - "time": "2013-08-03 15:35:31" + "time": "2015-08-12 15:56:39" } ], "packages-dev": [ @@ -761,12 +769,12 @@ "target-dir": "Guzzle/Common", "source": { "type": "git", - "url": "https://github.com/guzzle/common.git", + "url": "https://github.com/Guzzle3/common.git", "reference": "bf73c87375f60861f8c7ccc7b95878023ade5306" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/common/zipball/bf73c87375f60861f8c7ccc7b95878023ade5306", + "url": "https://api.github.com/repos/Guzzle3/common/zipball/bf73c87375f60861f8c7ccc7b95878023ade5306", "reference": "bf73c87375f60861f8c7ccc7b95878023ade5306", "shasum": "" }, @@ -805,12 +813,12 @@ "target-dir": "Guzzle/Http", "source": { "type": "git", - "url": "https://github.com/guzzle/http.git", + "url": "https://github.com/Guzzle3/http.git", "reference": "1034125dfd906b73119e535f03153a62fccb1989" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/http/zipball/1034125dfd906b73119e535f03153a62fccb1989", + "url": "https://api.github.com/repos/Guzzle3/http/zipball/1034125dfd906b73119e535f03153a62fccb1989", "reference": "1034125dfd906b73119e535f03153a62fccb1989", "shasum": "" }, @@ -862,12 +870,12 @@ "target-dir": "Guzzle/Parser", "source": { "type": "git", - "url": "https://github.com/guzzle/parser.git", + "url": "https://github.com/Guzzle3/parser.git", "reference": "a25c2ddda1c52fb69a4ee56eb530b13ddd9573c2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/parser/zipball/a25c2ddda1c52fb69a4ee56eb530b13ddd9573c2", + "url": "https://api.github.com/repos/Guzzle3/parser/zipball/a25c2ddda1c52fb69a4ee56eb530b13ddd9573c2", "reference": "a25c2ddda1c52fb69a4ee56eb530b13ddd9573c2", "shasum": "" }, @@ -906,12 +914,12 @@ "target-dir": "Guzzle/Stream", "source": { "type": "git", - "url": "https://github.com/guzzle/stream.git", + "url": "https://github.com/Guzzle3/stream.git", "reference": "a86111d9ac7db31d65a053c825869409fe8fc83f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/stream/zipball/a86111d9ac7db31d65a053c825869409fe8fc83f", + "url": "https://api.github.com/repos/Guzzle3/stream/zipball/a86111d9ac7db31d65a053c825869409fe8fc83f", "reference": "a86111d9ac7db31d65a053c825869409fe8fc83f", "shasum": "" }, @@ -1543,12 +1551,12 @@ "version": "v1.0.2", "source": { "type": "git", - "url": "https://github.com/fabpot/Pimple.git", + "url": "https://github.com/silexphp/Pimple.git", "reference": "ae11e57e8c2bb414b2ff93396dbbfc0eb92feb94" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fabpot/Pimple/zipball/ae11e57e8c2bb414b2ff93396dbbfc0eb92feb94", + "url": "https://api.github.com/repos/silexphp/Pimple/zipball/ae11e57e8c2bb414b2ff93396dbbfc0eb92feb94", "reference": "ae11e57e8c2bb414b2ff93396dbbfc0eb92feb94", "shasum": "" }, From a83bcaa8ac5e574d7616950cb8cd29221f6b75cc Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Thu, 13 Aug 2015 10:53:34 +0200 Subject: [PATCH 3/5] [ticket/14099] Fix tests PHPBB3-14099 --- phpBB/phpbb/template/asset.php | 8 ++++++++ tests/template/template_includecss_test.php | 11 ++--------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/phpBB/phpbb/template/asset.php b/phpBB/phpbb/template/asset.php index 67dbd7b357..e2edbcddc1 100644 --- a/phpBB/phpbb/template/asset.php +++ b/phpBB/phpbb/template/asset.php @@ -152,6 +152,13 @@ class asset */ public function set_path($path, $urlencode = false) { + // Since 1.7.0 Twig returns the real path of the file. We need it to be relative to the working directory. + $real_root_path = realpath('.') . DIRECTORY_SEPARATOR; + if ($real_root_path && substr($path . DIRECTORY_SEPARATOR, 0, strlen($real_root_path)) === $real_root_path) + { + $path = str_replace('\\', '/', substr($path, strlen($real_root_path))); + } + if ($urlencode) { $paths = explode('/', $path); @@ -161,6 +168,7 @@ class asset } $path = implode('/', $paths); } + $this->components['path'] = $path; } diff --git a/tests/template/template_includecss_test.php b/tests/template/template_includecss_test.php index 4ef9b90ec4..b025cd21d5 100644 --- a/tests/template/template_includecss_test.php +++ b/tests/template/template_includecss_test.php @@ -55,13 +55,6 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te public function template_data() { - $url_base = explode('/', dirname(__FILE__)); - foreach ($url_base as &$dir) - { - $dir = rawurlencode($dir); - } - $url_base = implode('/', $url_base); - return array( /* array( @@ -79,11 +72,11 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te ), array( array('TEST' => 3), - '', + '', ), array( array('TEST' => 4), - '', + '', ), ); } From 5b534369d1b35c945756e3f45545f0e2894bea71 Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Mon, 17 Aug 2015 10:27:21 +0200 Subject: [PATCH 4/5] [ticket/14099] Make composer.phar executable again PHPBB3-14099 --- composer.phar | Bin 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 composer.phar diff --git a/composer.phar b/composer.phar old mode 100644 new mode 100755 From 5f905f67ee79093a217f6ffbe1143386851b843d Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Tue, 18 Aug 2015 21:03:03 +0200 Subject: [PATCH 5/5] [ticket/14099] Fix the assets PHPBB3-14099 --- phpBB/phpbb/template/asset.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/phpBB/phpbb/template/asset.php b/phpBB/phpbb/template/asset.php index e2edbcddc1..ff9366af4a 100644 --- a/phpBB/phpbb/template/asset.php +++ b/phpBB/phpbb/template/asset.php @@ -153,10 +153,21 @@ class asset public function set_path($path, $urlencode = false) { // Since 1.7.0 Twig returns the real path of the file. We need it to be relative to the working directory. - $real_root_path = realpath('.') . DIRECTORY_SEPARATOR; - if ($real_root_path && substr($path . DIRECTORY_SEPARATOR, 0, strlen($real_root_path)) === $real_root_path) + $real_root_path = realpath($this->path_helper->get_phpbb_root_path()) . DIRECTORY_SEPARATOR; + + // If the asset is under the phpBB root path we need to remove its path and then prepend $phpbb_root_path + if (substr($path . DIRECTORY_SEPARATOR, 0, strlen($real_root_path)) === $real_root_path) { - $path = str_replace('\\', '/', substr($path, strlen($real_root_path))); + $path = $this->path_helper->get_phpbb_root_path() . str_replace('\\', '/', substr($path, strlen($real_root_path))); + } + else + { + // Else we make the path relative to the current working directory + $real_root_path = realpath('.') . DIRECTORY_SEPARATOR; + if ($real_root_path && substr($path . DIRECTORY_SEPARATOR, 0, strlen($real_root_path)) === $real_root_path) + { + $path = str_replace('\\', '/', substr($path, strlen($real_root_path))); + } } if ($urlencode)