diff options
| -rw-r--r-- | phpBB/composer.json | 2 | ||||
| -rw-r--r-- | phpBB/composer.lock | 21 | ||||
| -rw-r--r-- | phpBB/phpbb/template/asset.php | 7 | ||||
| -rw-r--r-- | tests/template/template_includecss_test.php | 11 | 
4 files changed, 23 insertions, 18 deletions
diff --git a/phpBB/composer.json b/phpBB/composer.json index 4d31eefa2b..6f813f00d9 100644 --- a/phpBB/composer.json +++ b/phpBB/composer.json @@ -36,7 +36,7 @@  		"symfony/routing": "2.5.*",  		"symfony/twig-bridge": "2.5.*",  		"symfony/yaml": "2.5.*", -		"twig/twig": "1.13.*" +		"twig/twig": "1.*"  	},  	"require-dev": {  		"fabpot/goutte": "1.0.*", diff --git a/phpBB/composer.lock b/phpBB/composer.lock index 62e7c83272..4941e61001 100644 --- a/phpBB/composer.lock +++ b/phpBB/composer.lock @@ -3,7 +3,7 @@          "This file locks the dependencies of your project to a known state",          "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file"      ], -    "hash": "2faf4ba24774c0d51cff4b78d4a81a68", +    "hash": "372e66644eb8d1504f88471de6d6dac6",      "packages": [          {              "name": "lusitanian/oauth", @@ -910,16 +910,16 @@          },          {              "name": "twig/twig", -            "version": "v1.13.2", +            "version": "v1.18.0",              "source": {                  "type": "git", -                "url": "https://github.com/fabpot/Twig.git", -                "reference": "6d6a1009427d1f398c9d40904147bf9f723d5755" +                "url": "https://github.com/twigphp/Twig.git", +                "reference": "4cf7464348e7f9893a93f7096a90b73722be99cf"              },              "dist": {                  "type": "zip", -                "url": "https://api.github.com/repos/fabpot/Twig/zipball/6d6a1009427d1f398c9d40904147bf9f723d5755", -                "reference": "6d6a1009427d1f398c9d40904147bf9f723d5755", +                "url": "https://api.github.com/repos/twigphp/Twig/zipball/4cf7464348e7f9893a93f7096a90b73722be99cf", +                "reference": "4cf7464348e7f9893a93f7096a90b73722be99cf",                  "shasum": ""              },              "require": { @@ -928,7 +928,7 @@              "type": "library",              "extra": {                  "branch-alias": { -                    "dev-master": "1.13-dev" +                    "dev-master": "1.18-dev"                  }              },              "autoload": { @@ -951,6 +951,11 @@                      "name": "Armin Ronacher",                      "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", @@ -958,7 +963,7 @@              "keywords": [                  "templating"              ], -            "time": "2013-08-03 15:35:31" +            "time": "2015-01-25 17:32:08"          }      ],      "packages-dev": [ diff --git a/phpBB/phpbb/template/asset.php b/phpBB/phpbb/template/asset.php index 67dbd7b357..4729685459 100644 --- a/phpBB/phpbb/template/asset.php +++ b/phpBB/phpbb/template/asset.php @@ -152,6 +152,12 @@ 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 +167,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 a8db74c3f1..96980e17c6 100644 --- a/tests/template/template_includecss_test.php +++ b/tests/template/template_includecss_test.php @@ -83,13 +83,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( @@ -107,11 +100,11 @@ class phpbb_template_template_includecss_test extends phpbb_template_template_te  			),  			array(  				array('TEST' => 3), -				'<link href="' . $url_base . '/ext/include/css/styles/all/theme/test.css?assets_version=1" rel="stylesheet" type="text/css" media="screen, projection" />', +				'<link href="tests/template/ext/include/css/styles/all/theme/test.css?assets_version=1" rel="stylesheet" type="text/css" media="screen, projection" />',  			),  			array(  				array('TEST' => 4), -				'<link href="' . $url_base . '/ext/include/css/styles/all/theme/child_only.css?assets_version=1" rel="stylesheet" type="text/css" media="screen, projection" />', +				'<link href="tests/template/ext/include/css/styles/all/theme/child_only.css?assets_version=1" rel="stylesheet" type="text/css" media="screen, projection" />',  			),  		);  	}  | 
