45 Commits

Author SHA1 Message Date
Luke Towers
c2ad6b309f Code style fix and replaced use of {% filter %} in the demo theme 2022-02-18 09:50:18 -06:00
Luke Towers
c713c7d8d5 Polyfill {% filter %} token removed in Twig v3 2022-02-18 09:33:22 -06:00
Ben Thomson
f4efb897ac
Retain spaceless tag in Twig (#456)
Keeps the {% spaceless %} ... {% endspaceless %} tag available in Twig 3.x for Winter CMS backwards compatibility.

While it was deprecated and removed in Twig 3.x, it appears to work still, but may need some more testing.
2022-02-18 09:25:12 -06:00
Luke Towers
a8160d017e Fix Twig type hints 2022-02-18 09:14:32 -06:00
Luke Towers
895c032196 loadTemplate($name) -> load($name)
Required as of Twig v3
2022-02-18 09:13:53 -06:00
Jack Wilkinson
d96231c57a
Added asset filter & function versions of all System Twig filters (#428) 2022-02-06 19:30:47 -06:00
Luke Towers
a984774144 Tweaks 2022-01-13 01:38:30 -06:00
Luke Towers
1e8cfb47af Manual comb through and rebrand following up the bulk patch rebrand 2021-03-10 15:25:57 -06:00
Luke Towers
cfa763b714 Initial rebrand commit generated from the 1.0 rebrand branch patch file 2021-03-10 15:02:53 -06:00
Luke Towers
f63519ff1e Further improvements to the Twig SecurityPolicy 2020-12-18 12:14:18 -06:00
Luke Towers
d34fb8ab51 Improve Twig security policy
Follow up to 106daa2930...7cb148c167. Thanks to @ka1n4t for the additional review.
2020-11-13 03:48:27 -06:00
Samuel Georges
3dc105173a Only allow local files via view engine
The Laravel view engine wants to supply the Twig engine with an absolute path, even though this is outside the inclusion rules. This implements a temporary exception to wave it through. It seems like a suitable alternative instead of implementing a reverse lookup to ensure the path is a valid view file, since we can trust the source engine has passed the value through its resolver already

Fixes previous fix
2020-10-13 19:14:49 +11:00
Samuel Georges
11c93f0a3b Fixes View::make recursion
This logic is called via {% include %} (fixed) and as a custom .htm driver for View::make (broken). The previous change was too aggressive and broke the latter. This still fixes arbitrary file inclusion whilst retaining the original design. Both logic paths are now fixed and have been tested
2020-10-11 19:05:38 +11:00
Samuel Georges
f9e14b02f5 Only allow view files in system twig
This no longer allows arbitrary inclusions, only views from the native Laravel view engine. Note this also affects the cms twig loader
2020-09-30 11:11:03 +10:00
Luke Towers
dd5fd34ae7 Merge branch '1.0' into develop 2020-09-04 01:27:53 -06:00
Luke Towers
7cb148c167 minor cleanup and docblocks 2020-09-04 01:23:03 -06:00
Samuel Georges
ceb2ff8a6e Clean up redundancies 2020-09-04 13:35:21 +10:00
Samuel Georges
4c650bb775 Security fixes for v1.0.469
Introduces sandbox policy to block extendable methods allowing arbitrary code execution
2020-09-04 13:02:01 +10:00
Luke Towers
444069da00 Finished implement imageWidth & imageHeight filters 2020-08-21 13:39:45 -06:00
Luke Towers
05731b1069 Fix bug 2020-08-18 13:41:53 -06:00
Luke Towers
288918a7d7 Finished initial implementation of resizer for all supported input image sources, added the storage/app/resized directory to the mirror command 2020-08-14 15:39:30 -06:00
Luke Towers
7b9408e394 More WIP, moved logic in the appropriate locations 2020-08-07 23:27:32 -06:00
Ben Thomson
a59d3b83eb Code quality clean up (#4449)
Credit to @bennothommo
2019-07-18 08:50:37 -06:00
Luke Towers
c86bec7f08 Replace deprecated Twig class references, refs: #4209. 2019-03-27 13:15:17 -06:00
Nathan van der Werf
0f0d108da0
Remove unused imports 2018-08-24 19:51:59 +02:00
Nathan van der Werf
66fa03f17e
Revert "Remove unused imports"
This reverts commit 742a5f415bc45819b11c77402efc114fa2f4451e.
2018-08-24 19:40:40 +02:00
Nathan van der Werf
742a5f415b Remove unused imports 2018-08-15 18:27:36 +02:00
Arthur Kushman
c78b3ef786 Code formatting changes (#3363)
Code formatting improvements submitted by @arthurkushman.
2018-03-22 10:55:13 -06:00
Christophe Vuagniaux
c7dcd386d1 Fix exception Class 'System\Twig\MediaLibrary' not found in build 426 (#3181)
see 08f9cd8
2017-10-18 07:56:52 -06:00
Luke Towers
08f9cd8448 Moved the |media twig filter from the CMS module to the System module 2017-09-27 22:15:01 -06:00
Christian
98bc0c0977 Laravel 5.5 Engine directory change
They moved the Engine interface to Contracts so this is a small fix.
2017-08-08 21:55:48 -04:00
Samuel Georges
18b9253bcb Change to mail partial syntax 2017-07-26 17:48:00 +10:00
Samuel Georges
9287d926f7 Refit invite and restore mail templates
Fixes {% partial %} node for mail templates
Trim body var for text emails
Style code nodes
2017-07-22 22:23:22 +10:00
Samuel Georges
4663531de2 Introduce mail partials + twig
Improve layout seeding
2017-07-19 21:14:08 +10:00
Samuel Georges
e2781c5fdf URL -> Url 2017-06-02 23:34:50 +10:00
Samuel Georges
6b74efa4b0 Improves the DebugExtension
It now uses the HtmlDumper from Illuminate to elaborate on each variable when clicked
getName() no longer needed on Twig extensions
2017-05-13 10:20:18 +10:00
Samuel Georges
2b5709adb9 Bump Twig to v2, refit code 2017-05-13 09:34:20 +10:00
Samuel Georges
b1b700368f Radical reorg of some classes 2015-01-28 11:49:54 +11:00
Sam Georges
c83797231d Subsequent expressions are on a new line (see developer guide > PSR exceptions) 2014-11-01 12:00:45 +11:00
Stefan Talen
f85087eac6 Updating modules/system 2014-10-18 11:58:50 +02:00
Sam Georges
56d0c3351b private -> protected 2014-08-01 14:54:16 +10:00
Sam Georges
3c7c87b338 Fixes #254 add Laravel helper functions to Twig environment 2014-07-16 10:30:39 +10:00
Sam Georges
5c005f79d0 System Twig environment is now extended by plugins
Move the markup manager to system
2014-06-28 21:23:13 +10:00
Sam Georges
9d2d9b621f Create a System Twig extension, for shared features 2014-06-26 17:29:03 +10:00
Sam Georges
71a5dd67ab Welcome to the world, October :-) 2014-05-14 23:24:20 +10:00