diff options
| -rwxr-xr-x | composer.phar | bin | 1075150 -> 1075373 bytes | |||
| -rw-r--r-- | phpBB/composer.json | 2 | ||||
| -rw-r--r-- | phpBB/composer.lock | 48 | ||||
| -rw-r--r-- | phpBB/phpbb/template/asset.php | 19 | ||||
| -rw-r--r-- | tests/template/template_includecss_test.php | 11 | 
5 files changed, 50 insertions, 30 deletions
| diff --git a/composer.phar b/composer.pharBinary files differ index 3481b599b7..a3bd28e4f4 100755 --- a/composer.phar +++ b/composer.phar 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": ""              }, diff --git a/phpBB/phpbb/template/asset.php b/phpBB/phpbb/template/asset.php index 67dbd7b357..ff9366af4a 100644 --- a/phpBB/phpbb/template/asset.php +++ b/phpBB/phpbb/template/asset.php @@ -152,6 +152,24 @@ 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($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 = $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)  		{  			$paths = explode('/', $path); @@ -161,6 +179,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), -				'<link href="' . $url_base . '/ext/include/css/styles/all/theme/test.css?assets_version=1" rel="stylesheet" type="text/css" media="screen" />', +				'<link href="tests/template/ext/include/css/styles/all/theme/test.css?assets_version=1" rel="stylesheet" type="text/css" media="screen" />',  			),  			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" />', +				'<link href="tests/template/ext/include/css/styles/all/theme/child_only.css?assets_version=1" rel="stylesheet" type="text/css" media="screen" />',  			),  		);  	} | 
