Commit Graph

797 Commits

Author SHA1 Message Date
Fabien Potencier c19448545a minor #2241 added some more tests (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

added some more tests

Commits
-------

b23cc3b added some more tests
2016-11-11 13:49:36 -08:00
Fabien Potencier b23cc3b4a1 added some more tests 2016-11-11 13:45:13 -08:00
Fabien Potencier c81bae489e added 'is defined' support for constant 2016-11-11 13:40:51 -08:00
Fabien Potencier 3ce06af6b4 added 'is defined' support for block() 2016-11-11 12:03:32 -08:00
Martin Hasoň 4f013e09ea Add test to check if a block exists 2016-11-11 12:02:25 -08:00
Fabien Potencier a63ee7c6fb added a proper error message when block() is called without arguments 2016-11-10 21:27:25 -08:00
Fabien Potencier 56e09fb7d3 added testing PHP 7.1 2016-11-10 11:15:19 -08:00
Matthias Pigulla ff0abbb7e8 Load templates from cache, even if they have just been compiled 2016-11-07 19:10:26 -08:00
Fabien Potencier 47432f3244 fixed regression when registering two extensions having the same class name 2016-10-23 13:11:53 -07:00
Fabien Potencier 21ecba8c44 made using Twig_SourceContextLoaderInterface required 2016-10-21 17:07:14 -07:00
Fabien Potencier 8c337082bb made name required for Twig_Source 2016-10-21 16:09:51 -07:00
Fabien Potencier fbf1391cbd feature #2195 fixed the filesystem loader with relative paths (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

fixed the filesystem loader with relative paths

closes #2145

TODO

 - [x] document the new `$rootPath` option
 - [x] add test with a `$rootPath` different from `getcwd()`
 - [x] test the cache key does not vary when `$rootPath` changes

Commits
-------

a343c92 fixed the filesystem loader with relative paths
2016-10-21 07:02:50 -07:00
Fabien Potencier a343c92805 fixed the filesystem loader with relative paths 2016-10-21 06:52:23 -07:00
Fabien Potencier 09aa73f2f2 bug #2192 fixed Twig_Loader_Chain logic (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

fixed Twig_Loader_Chain logic

Commits
-------

a2b9426 fixed Twig_Loader_Chain logic
2016-10-20 08:17:54 -07:00
Fabien Potencier e231aa539f renamed Twig_Node::getName() to Twig_Node::getTemplateName() 2016-10-19 14:59:16 -07:00
Fabien Potencier a2b94266e3 fixed Twig_Loader_Chain logic 2016-10-19 14:33:38 -07:00
Fabien Potencier ae9656a8b1 fixed typo 2016-10-17 15:39:21 -07:00
Fabien Potencier 7082738cbf optimized generated code 2016-10-17 15:37:49 -07:00
Fabien Potencier 7598f27e6d deprecated Twig_Template::getSource() in favor of Twig_Template::getSourceContext() 2016-10-17 15:30:12 -07:00
Fabien Potencier d03297ed52 deprecated Twig_Node::getFilename() in favor of Twig_Node::getName() 2016-10-17 15:04:06 -07:00
Fabien Potencier eb47dc95d8 got rid of filename when we meant template name 2016-10-17 14:57:53 -07:00
Fabien Potencier 6c76583e23 added Twig_Source to hold information about the original template 2016-10-17 13:33:17 -07:00
Fabien Potencier b399ec0d1a deprecated Twig_Error::getTemplateFile() and Twig_Error::setTemplateFile() 2016-10-17 13:20:25 -07:00
Kit Burton-Senior e1c980fa87 Improved Sandbox error handling 2016-10-12 11:47:36 -07:00
Fabien Potencier 7a047679ab removed template source code for generated template classes when debug is disabled 2016-10-05 11:41:41 -07:00
Fabien Potencier e01c29be32 fixed regression on static calls for functions/filters/tests 2016-10-05 11:02:40 -07:00
Fabien Potencier 91d2adc061 bug #2152 normalizePath: Do not mangle phar URLs. (apapsch)
This PR was squashed before being merged into the 1.x branch (closes #2152).

Discussion
----------

normalizePath: Do not mangle phar URLs.

Removing consecutive slashes breaks phar URLs. Example:
phar:///foo/bar is turned into phar:/foo/bar.

This change preserves the three slashes if path starts with phar://.

Commits
-------

7dd63fc normalizePath: Do not mangle phar URLs.
2016-09-29 20:46:34 -07:00
Aljosha Papsch 7dd63fc087 normalizePath: Do not mangle phar URLs. 2016-09-29 20:46:32 -07:00
Fabien Potencier 9cb6860e53 allowed filters/functions/tests implementation to use a different class than the extension they belong to 2016-09-29 11:43:35 -07:00
Fabien Potencier 71f03df011 deprecated Twig_ExtensionInterface::getName() 2016-09-28 10:05:09 -07:00
Fabien Potencier 52e9e01353 minor #2150 added some missing tests for functions/filters as static calls (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

added some missing tests for functions/filters as static calls

Commits
-------

c73e97e added some missing tests for functions/filters as static calls
2016-09-27 10:24:00 -07:00
Fabien Potencier c73e97ece4 added some missing tests for functions/filters as static calls 2016-09-27 10:19:55 -07:00
Fabien Potencier c96ffc314f fixed CS 2016-09-26 21:00:51 -07:00
Fabien Potencier 9ee6fe3380 adding missing dots to some exception messages 2016-09-24 12:21:25 -07:00
Fabien Potencier 73d029b212 minor #2143 fixed exception message that might end with a ? (fabpot)
This PR was merged into the 1.x branch.

Discussion
----------

fixed exception message that might end with a ?

Commits
-------

5c43548 adding missing dots to some exception messages
fbf99fc fixed exception message that might end with a ?
2016-09-24 12:00:56 -07:00
Fabien Potencier b2a1805146 fixed error message 2016-09-24 12:00:09 -07:00
Javier Eguiluz 23f53d5968 Improved the error message when a child template defines contents outside parent blocks 2016-09-24 11:56:13 -07:00
Fabien Potencier 5c43548dde adding missing dots to some exception messages 2016-09-24 11:53:49 -07:00
Fabien Potencier b55d907c94 changed the way we store template source in template classes 2016-09-20 10:55:24 -07:00
Fabien Potencier 6f0e3edbc5 removed usage of realpath in cache key 2016-09-20 10:26:50 -07:00
Fabien Potencier 85fb2a1f45 fixed a test 2016-09-19 18:26:28 -07:00
Fabien Potencier a0489854ba fixed embed parent token for simple use cases 2016-09-19 16:37:28 -07:00
Fabien Potencier 03f18b44f4 enforced Node:: to only contain node instances 2016-09-19 13:32:58 -07:00
Fabien Potencier ec7a1c1856 changed a test to make it more robust 2016-09-18 18:37:13 -07:00
SpacePossum 39d46acf7d Floor - use cast and not intval 2016-08-31 11:41:06 -07:00
Fabien Potencier d726bde293 bug #2054 Fix static callable. (SpacePossum)
This PR was merged into the 1.x branch.

Discussion
----------

Fix static callable.

fixes https://github.com/twigphp/Twig/issues/2053

Commits
-------

8f6fd57 Fix exception message for static method and object without req. params.
2016-08-17 17:08:36 -07:00
Sam Mousa 17e0caa91a Fixed all deprecation notices by using 2016-07-28 16:56:02 -04:00
SpacePossum 8f6fd57a7e Fix exception message for static method and object without req. params. 2016-06-22 09:22:42 +02:00
Uwe Jäger ee6965ed00 fix a case where the autoescaping does not work as expected
The Twig_NodeVisitor_Escaper collects a list of blocks for all templates that it visits. If you define the same block (i.e. with the same name) in txt and html templates this results sometimes in the html block not being escapes.

This is illustrated in the added test.

To fix it, I propose to reset the list of the blocks for each module.

Alternatively we need to make clear that blocks should not share names between text and html templates.
2016-06-02 08:40:59 +02:00
Filip Procházka 99e9d1cf41 handle Throwable 2016-05-13 12:08:51 +02:00