diff options
Diffstat (limited to 'phpBB/phpbb/template')
15 files changed, 20 insertions, 14 deletions
| 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/phpBB/phpbb/template/twig/node/definenode.php b/phpBB/phpbb/template/twig/node/definenode.php index c110785c4b..ddbd151d20 100644 --- a/phpBB/phpbb/template/twig/node/definenode.php +++ b/phpBB/phpbb/template/twig/node/definenode.php @@ -14,7 +14,6 @@  namespace phpbb\template\twig\node; -  class definenode extends \Twig_Node  {  	public function __construct($capture, \Twig_NodeInterface $name, \Twig_NodeInterface $value, $lineno, $tag = null) diff --git a/phpBB/phpbb/template/twig/node/event.php b/phpBB/phpbb/template/twig/node/event.php index 8fc4ba4775..b765bde98d 100644 --- a/phpBB/phpbb/template/twig/node/event.php +++ b/phpBB/phpbb/template/twig/node/event.php @@ -13,7 +13,6 @@  namespace phpbb\template\twig\node; -  class event extends \Twig_Node  {  	/** diff --git a/phpBB/phpbb/template/twig/node/expression/binary/equalequal.php b/phpBB/phpbb/template/twig/node/expression/binary/equalequal.php index 8c7f7b378d..2cd15d59da 100644 --- a/phpBB/phpbb/template/twig/node/expression/binary/equalequal.php +++ b/phpBB/phpbb/template/twig/node/expression/binary/equalequal.php @@ -13,7 +13,6 @@  namespace phpbb\template\twig\node\expression\binary; -  class equalequal extends \Twig_Node_Expression_Binary  {  	public function operator(\Twig_Compiler $compiler) diff --git a/phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php b/phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php index 2e95c68090..5f2908fb9b 100644 --- a/phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php +++ b/phpBB/phpbb/template/twig/node/expression/binary/notequalequal.php @@ -13,7 +13,6 @@  namespace phpbb\template\twig\node\expression\binary; -  class notequalequal extends \Twig_Node_Expression_Binary  {  	public function operator(\Twig_Compiler $compiler) diff --git a/phpBB/phpbb/template/twig/node/includecss.php b/phpBB/phpbb/template/twig/node/includecss.php index 2ce63402aa..2dac154036 100644 --- a/phpBB/phpbb/template/twig/node/includecss.php +++ b/phpBB/phpbb/template/twig/node/includecss.php @@ -31,7 +31,7 @@ class includecss extends \phpbb\template\twig\node\includeasset  		$compiler  			->raw("<link href=\"' . ")  			->raw("\$asset_file . '\"") -			->raw(' rel="stylesheet" type="text/css" media="screen, projection" />') +			->raw(' rel="stylesheet" type="text/css" media="screen" />')  		;  	}  } diff --git a/phpBB/phpbb/template/twig/node/includenode.php b/phpBB/phpbb/template/twig/node/includenode.php index 42428b6106..c36ac3c324 100644 --- a/phpBB/phpbb/template/twig/node/includenode.php +++ b/phpBB/phpbb/template/twig/node/includenode.php @@ -13,7 +13,6 @@  namespace phpbb\template\twig\node; -  class includenode extends \Twig_Node_Include  {  	/** diff --git a/phpBB/phpbb/template/twig/node/includephp.php b/phpBB/phpbb/template/twig/node/includephp.php index 659495fd9e..76182c2f84 100644 --- a/phpBB/phpbb/template/twig/node/includephp.php +++ b/phpBB/phpbb/template/twig/node/includephp.php @@ -14,7 +14,6 @@  namespace phpbb\template\twig\node; -  class includephp extends \Twig_Node  {  	/** @var \Twig_Environment */ diff --git a/phpBB/phpbb/template/twig/node/php.php b/phpBB/phpbb/template/twig/node/php.php index 3a24513dca..4ee415e446 100644 --- a/phpBB/phpbb/template/twig/node/php.php +++ b/phpBB/phpbb/template/twig/node/php.php @@ -13,7 +13,6 @@  namespace phpbb\template\twig\node; -  class php extends \Twig_Node  {  	/** @var \Twig_Environment */ diff --git a/phpBB/phpbb/template/twig/tokenparser/defineparser.php b/phpBB/phpbb/template/twig/tokenparser/defineparser.php index 2b88d61118..b755836ccd 100644 --- a/phpBB/phpbb/template/twig/tokenparser/defineparser.php +++ b/phpBB/phpbb/template/twig/tokenparser/defineparser.php @@ -14,7 +14,6 @@  namespace phpbb\template\twig\tokenparser; -  class defineparser extends \Twig_TokenParser  {  	/** diff --git a/phpBB/phpbb/template/twig/tokenparser/event.php b/phpBB/phpbb/template/twig/tokenparser/event.php index 4c7c8e07d9..f73ef4ae25 100644 --- a/phpBB/phpbb/template/twig/tokenparser/event.php +++ b/phpBB/phpbb/template/twig/tokenparser/event.php @@ -13,7 +13,6 @@  namespace phpbb\template\twig\tokenparser; -  class event extends \Twig_TokenParser  {  	/** diff --git a/phpBB/phpbb/template/twig/tokenparser/includejs.php b/phpBB/phpbb/template/twig/tokenparser/includejs.php index 4156048e42..4b67d2c468 100644 --- a/phpBB/phpbb/template/twig/tokenparser/includejs.php +++ b/phpBB/phpbb/template/twig/tokenparser/includejs.php @@ -13,7 +13,6 @@  namespace phpbb\template\twig\tokenparser; -  class includejs extends \Twig_TokenParser  {  	/** diff --git a/phpBB/phpbb/template/twig/tokenparser/includeparser.php b/phpBB/phpbb/template/twig/tokenparser/includeparser.php index 6ee78e5562..aa7236aaa6 100644 --- a/phpBB/phpbb/template/twig/tokenparser/includeparser.php +++ b/phpBB/phpbb/template/twig/tokenparser/includeparser.php @@ -14,7 +14,6 @@  namespace phpbb\template\twig\tokenparser; -  class includeparser extends \Twig_TokenParser_Include  {  	/** diff --git a/phpBB/phpbb/template/twig/tokenparser/includephp.php b/phpBB/phpbb/template/twig/tokenparser/includephp.php index c09f7729b0..3992636f8c 100644 --- a/phpBB/phpbb/template/twig/tokenparser/includephp.php +++ b/phpBB/phpbb/template/twig/tokenparser/includephp.php @@ -14,7 +14,6 @@  namespace phpbb\template\twig\tokenparser; -  class includephp extends \Twig_TokenParser  {  	/** diff --git a/phpBB/phpbb/template/twig/tokenparser/php.php b/phpBB/phpbb/template/twig/tokenparser/php.php index 557a70cca1..f11ce35896 100644 --- a/phpBB/phpbb/template/twig/tokenparser/php.php +++ b/phpBB/phpbb/template/twig/tokenparser/php.php @@ -13,7 +13,6 @@  namespace phpbb\template\twig\tokenparser; -  class php extends \Twig_TokenParser  {  	/** | 
