Justin Hileman
d36cd805c4
Bump to v2.14.1
2022-01-21 01:21:32 -05:00
Justin Hileman
579ffa5c96
Fix CVE-2022-0323 (improper neutralization of section names)
...
- Fixes possible RCE when rendering untrusted user templates.
- Remove unnecessary comments in generated source.
2022-01-21 01:08:36 -05:00
Justin Hileman
076209772d
Explicitly treat null as an empty string when interpolating.
...
Fixes a deprecation warning on PHP 8.1+, and saves us some unnecessary escaping calls!
Thanks for your help @scr4bble :)
Fixes #383
2022-01-21 00:47:28 -05:00
Justin Hileman
7fd191f730
Remove unused variable.
2022-01-21 00:38:13 -05:00
Justin Hileman
e7165a33b2
Only check for mbstring.func_overload in < PHP 8.x
...
Fixes #385
2022-01-07 21:35:06 -05:00
Justin Hileman
26c8a448fc
Fix PHP 8.1 deprecation warning when user lambdas do not return a string
...
Fixes #382
2021-12-21 23:11:27 -05:00
Justin Hileman
3ce0ee0ec1
Bump to v2.14.0, bump spec version to 1.2.2
2021-12-14 09:42:05 -05:00
Alain Schlesser
09adfdec76
Ensure $delimiters is a string before trimming
2021-12-12 08:51:03 -05:00
Alain Schlesser
d5499fc8fc
Avoid using trim() on null
2021-12-09 15:25:30 -05:00
Justin Hileman
db2bc776c4
Add missing setLogger to Mustache_Cache interface.
...
Fixes #358
2021-04-28 10:48:42 -07:00
Justin Hileman
799c0f40fd
Throw a Mustachey runtime exception from filesystem source.
...
Fixes #370
2021-04-28 10:25:13 -07:00
Justin Hileman
d2503c7a29
Merge pull request #343 from Rarst/patch-1
...
Adjusted log level argument type
2021-04-28 10:21:12 -07:00
Justin Hileman
819a3e1e46
Bump to v2.13.0
2019-11-23 13:38:47 -08:00
Joyce Babu
6d28b0b28d
Prevent array access on null value
...
Fix 'Trying to access array offset on value of type null' notice on PHP
7.4
2019-11-23 10:45:55 -08:00
Justin Hileman
72d07520ec
Improve Tokenizer::scan performance by 98.2%.
...
- Checking the first character of the opening and closing tags is >90% faster than baseline for my test case.
- Inlining the `tagChange` method is 18% faster than baseline.
- Together they yield a 98.2% wall clock time improvement!
Hat tip to @sam-osborne for the first one :)
https://github.com/mardix/Handlebars/pull/6
2019-07-21 16:02:17 -07:00
Justin Hileman
bbb43caa1a
Fix delimiter parse error, and throw a syntax error when invalid.
...
The mustache spec has a test case that _should_ have caught this:
https://github.com/mustache/spec/blob/master/specs/delimiters.yml#L154-L158
... But that test case only tests that an engine recognizes it as a delimiter change tag, not that it ends up changing to the correct delimiters. In our case, we were incorrectly changing to `@` and ` `.
The only "invalid" case I can think of is missing delimiters, which is how that spec test was (incorrectly) parsed. Now it'll enforce that it's always called with *something* that can be used as a delimiter.
2019-07-21 16:02:17 -07:00
Andrey Savchenko
bfb6d7732e
Adjusted log level argument type.
2018-11-30 17:45:52 +02:00
Justin Hileman
8c261cf50f
Bump to v2.12.0
2017-07-11 05:53:22 -07:00
Justin Hileman
55e6ac81ba
Add validation to prevent empty template_class_prefix.
...
Fixes #298
2017-07-03 00:24:50 -07:00
Justin Hileman
7434e97df5
Swallow errors on stat in FilesystemSource.
2017-07-03 00:16:38 -07:00
Justin Hileman
89987ac890
Fix a comment that had become a lie.
2017-07-03 00:16:21 -07:00
Justin Hileman
6a527de467
Mark a few things we can't really get code coverage for.
2017-07-03 00:16:08 -07:00
Justin Hileman
2b76cbeb66
Remove unused internal compiler arg.
...
We stopped passing it in 11ad87ae but missed the cleanup.
2017-07-02 22:55:12 -07:00
Justin Hileman
324f1db963
Bump copyright year.
2017-07-02 22:24:03 -07:00
Justin Hileman
b9f04e5d26
Custom delimiters tweaks.
...
* Add basic test for custom delimiters
* Keep default delims backwards compatible
2017-07-02 22:20:51 -07:00
Justin Hileman
556b8e67b8
Clean up Source implementation a bit.
...
Make it work with new template class name logic.
2017-07-02 21:50:12 -07:00
Justin Hileman
1514e0c2cd
Add stat() options to ProductionFilesystemLoader
...
* By default, continue to use `size` and `mtime` to invalidate template cache
* Allow overriding to use any properties of `stat()`
* Allow disabling stat entirely
* Add a Big Kid Pants disclaimer if you choose to go down this path
2017-07-02 16:30:46 -07:00
Justin Hileman
ca19ba467e
Initial production FilesystemSource implementation
...
See #290
2017-07-02 16:30:46 -07:00
Justin Hileman
31523441e1
Add delimiters option docs.
2017-07-02 14:46:56 -07:00
Justin Hileman
ccb2b09317
Update generated class name for delimiters option.
...
Add some docs there, make it slightly easier to update the generated class name.
2017-07-02 14:39:07 -07:00
Justin Hileman
44489124a1
CS fixes.
2017-07-02 14:39:07 -07:00
Jager Mesh
329146d864
support for delimiters configuration
2017-07-02 14:39:07 -07:00
Justin Hileman
09241edd52
Use a local $blocksContext for each parent render.
...
... rather than a shared one per template / section / block that accidentally keeps old block context around.
Fixes #322
2017-06-29 00:13:59 -07:00
Justin Hileman
44baf86426
Suppress else when rendering empty block defaults.
2017-06-28 23:20:21 -07:00
Brendan Anderson
7cb5f3f08f
Prevent redundant autoloader registerations. Fixes #304
2017-01-02 10:22:37 -05:00
Justin Hileman
87e87e29fe
Bump to v2.11.1
2016-07-30 23:18:19 -07:00
Justin Hileman
cf4e4c7857
Bump to v2.11.0
2016-07-30 23:07:36 -07:00
Justin Hileman
d4bdf110f9
Always check is_dir() and file_exists() with filesystem streams.
2016-07-30 22:59:23 -07:00
Justin Hileman
18a2adce3d
Remove all the extra spaces StyleCI wanted me to add :)
2016-07-30 22:39:43 -07:00
Olav Schettler
fee4544785
Allow to load non-local templates
2016-07-30 22:38:07 -07:00
Justin Hileman
01777faf6e
Various style cleanups.
...
* a bunch of small changes, courtesy of styleci
* update dates in file headers
* add file headers to files that are missing them
2016-07-30 17:57:19 -07:00
Justin Hileman
051f857197
Support parent tags and block args as direct children of blocks and sections.
...
Fixes #294
Drive-by: rename blocks context variable to something more descriptive.
2016-05-18 22:45:46 -07:00
Justin Hileman
1de7898200
Fix incorrect method name case.
2016-05-18 21:48:17 -07:00
Justin Hileman
4aa31aca56
Merge pull request #288 from thewilkybarkid/exception-previous
...
Add exception chaining
2016-03-19 00:35:21 -07:00
Justin Hileman
a9dd4c62ae
Bump to v2.10.0
2016-02-27 11:21:57 -08:00
Chris Wilkinson
c858bb1f1a
Add exception chaining
2016-02-23 07:49:22 +00:00
Justin Hileman
865de4114a
Make LambdaHelper invokable.
...
Fixes #285
2016-02-14 08:43:38 -08:00
Justin Hileman
f3ae65eb33
Fix incorrect indent on interpolated lambdas.
...
Fixes #286
2016-02-14 08:37:41 -08:00
Justin Hileman
9cc21d63f7
Respect delimiter changes in lambda helper.
...
See janl/mustache.js#489
2015-10-12 12:48:21 -07:00
Justin Hileman
eff33aff4e
Bump to v2.9.0
2015-08-15 12:18:51 -07:00