113 Commits

Author SHA1 Message Date
Marc Jauvin
34609321b9
Add support for pathSymbols in asset filenames (#874) 2023-03-30 08:46:04 -06:00
Luke Towers
f360667f2c
relativePath can be null
Relative path is generated from $this->assetPath which is by default null. Changing it to be an empty string by default instead would have consequences further down the line in the CombineAssets class.
2022-08-01 21:29:52 -06:00
Ben Thomson
7a25524f73
Fix site relative partial paths failing in 1.2 (#587)
Matches the behavior of the ViewMaker in the 1.1 branch more closely by checking if the partial path is a local reference first, returning that path if it is. Only if this check fails will it then run through the view paths.

Fixes https://github.com/wintercms/winter/issues/571

Also fixes the ViewMaker tests by emulating the same behaviour as a web request and having the current directory be the base path of the site, not the directory of the current module or plugin being tested.
2022-06-24 22:09:40 -06:00
Jack Wilkinson
907393a586
Respect app.asset_url in AssetMaker (#552) 2022-05-12 12:52:24 -06:00
Ben Thomson
a64422be20 View Maker guessed paths can be null 2022-05-12 09:10:24 +08:00
Luke Towers
c9c4b6113c Fix windows tests & update references to backend view files 2022-05-02 13:02:34 -06:00
Luke Towers
643a581ce9 Add support for .php as a backend partial extension 2022-05-01 23:50:38 -06:00
Luke Towers
ae5b0c2a54 Fix issue with refactored Symfony component 2022-03-08 19:43:13 -06:00
Luke Towers
a8160d017e Fix Twig type hints 2022-02-18 09:14:32 -06:00
Ben Thomson
845fe50cba Define signature for "defineProperties" method 2021-12-09 11:46:38 +08:00
Luke Towers
0c5099f0b1 Throw SystemException for critical not-found code paths
Throws SystemException (therefor creating critical logged errors) for code paths resulting in not found exceptions (AJAX handlers, partials, content, components, etc) to make it easier to identify and result issues before end users are affected.
2021-07-19 17:11:29 -06:00
Luke Towers
4a6bc4df6a
Add support for plugin replacement / forking (#41)
Documented by https://github.com/wintercms/docs/pull/11

Co-authored-by: @jaxwilko Jack Wilkinson <me@jackwilky.com>
Co-authored-by: @mjauvin Marc Jauvin <marc.jauvin@gmail.com>
Co-authored-by: @bennothommo Ben Thomson <git@alfreido.com>
Co-authored-by: @LukeTowers  Luke Towers <github@luketowers.ca>
2021-04-21 13:50:59 -06:00
Luke Towers
799fb0eecb Improve support for auto aliasing october* assets 2021-04-06 23:02:11 -06:00
Luke Towers
72f87f2dad improve asset aliasing 2021-03-12 09:27:01 -06:00
Luke Towers
df7ec62402 Alias october.* assets to winter.* 2021-03-12 09:15:24 -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
Romain 'Maz' BILLOIR
becb688123
Fix docblocks of addCss/Js: add array to $name type (#5491) 2021-02-03 20:53:12 -06:00
Samuell
5d0988559b
Component property can be mixed value (#5355) 2020-11-16 01:36:55 -06:00
Raja Khoury
561815cac1
Define beforeAddAsset properties as references in docs. (#5269) 2020-09-09 10:18:51 +08:00
Samuel Georges
e3b42b2f10 Make cms.backendForceSecure an explicit setting
This no longer hinges on app.debug because it creates confusion for devops engineers. This is based on three independent reports coming from app environments that use a reverse proxy. The engineer will follow the proper security instructions by disabling debug mode, which in turn creates an infinite redirect loop when opening the back-end area, only to leave them scratching their heads

Ultimately it is the web server configuration's job to handle the enforcement of HTTPS, the app no longer enforces it as a strong opinion, but we still keep the setting available as a convenient security check for standard environments that do not use a reverse proxy
2020-01-18 18:05:26 +11:00
Marc Jauvin
992e84e602 Add missing documentation comment blocks for fired events (#4788)
Credit to @mjauvin.
2019-11-24 23:59:00 -06:00
Luke Towers
615c4cdb04 Change default of cms.backendForceSecure to reflect the config default that's been in place since 2016. 2019-11-07 12:14:32 -06:00
Samuel Georges
63f65a3f25 Add XSRF to backend, simplify CMS controller run() method
runInternal has been removed because we do not want to blanket our response logic over every single response, only the happy path. This is because it is impossible to remove. So it is better to take the inverted approach, where if you want the CMS' headers in your custom response, add them yourself. This becomes easy via the new makeResponse() method
2019-11-02 19:14:45 +11:00
Samuel Georges
9d120ad66b Add header and cookie support to ResponseMaker 2019-11-02 18:57:32 +11:00
Samuel Georges
ff8f899fbe Move response common functions to ResponseMaker trait 2019-11-02 18:21:22 +11:00
Samuel Georges
b1fa45ee3a Combine common CSRF logic to a trait 2019-11-02 15:15:18 +11:00
Luke Towers
e246427463 Provide system.assets.beforeAddAsset event to modify asset attributes
Fixes octobercms/october#4611 (when combined with a PR to https://github.com/heathdutton/cloudflare)
Related: octobercms/october#4092, octobercms/october#3841, octobercms/october#3839
2019-10-09 11:51:06 -06:00
Samuell
33d149fe1a Replace caching of Theme config with generic YAML caching (#4526)
Credit to @Samuell1. Fixes issues related to complexity of the existing approach / cache invalidation by just using the caching built in to YAML::parseFile().
2019-09-25 11:36:35 -06:00
Ben Thomson
a59d3b83eb Code quality clean up (#4449)
Credit to @bennothommo
2019-07-18 08:50:37 -06:00
Rachasak Ragkamnerd
70cd444f8a Added support for 'cache' attribute to addJs() to disable CF RocketLoader (#4092)
Credit to @itpcc 

Due to CloudFlare Rocket Loader, CF will automatically try to optimize page loading speed by changing script type attribute. This breaks the script execution order and makes the user unable to upload the file(s) in the backend using "FileUpload" widget.

However, [CloudFlare allows adding "data-cfasync"](https://support.cloudflare.com/hc/en-us/articles/200169436-How-can-I-have-Rocket-Loader-ignore-specific-JavaScripts-) to prevent this. And it was used in the [commit #3841](https://github.com/octobercms/october/pull/3841/files).
2019-04-16 20:27:13 -06:00
Luke Towers
639339d55e Stop automatically creating camel case versions of top level configuration keys
This would cause issues with repeaters in grouped mode that have an underscore in one of the groups as it would duplicate that group entry.
2019-03-18 14:08:47 -06:00
Nicolas Da Mutten
aeb7616d06 Automatically use local asset path when attempting to combine injected assets (#3802)
Credit to @cleverer. Fixes #3264.
2018-09-24 14:17:00 -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
8b6f11e6ac Extract child instructions 2018-08-15 19:25:42 +02:00
Nathan van der Werf
fbca3bea92 Remove redundant variables 2018-08-15 19:23:12 +02:00
Nathan van der Werf
62c59a4903 Refactor ternary operators to null coalescing operators 2018-08-15 19:15:13 +02:00
Nathan van der Werf
123145fd54 Remove unnecessary parentheses 2018-08-15 18:49:52 +02:00
Nathan van der Werf
742a5f415b Remove unused imports 2018-08-15 18:27:36 +02:00
Lucas Thurston
85dd0b9968 Add config flag for disabling basedir restrictions for local development only (#3626)
Fixes #3619. Credit to @lthurston
2018-07-05 17:07:38 -04:00
Samuel Georges
fb2aa1730c Fixes security issue
Refs #3604
2018-06-22 22:57:38 +10:00
Luke Towers
7d4912b80a Revert "Use fireCombinedEvent to handle fireSystemEvent."
This reverts commit eb5b568b6f4e29e0920c2fe107e8d7ba045fec1d.
2018-05-17 02:16:19 -06:00
Luke Towers
eb5b568b6f Use fireCombinedEvent to handle fireSystemEvent.
Refs: d0cdf0ae6e
2018-05-17 01:44:41 -06:00
Luke Towers
5acbdb12fe Compiled assets and whitespace cleanup 2018-04-17 13:43:51 -06:00
Vojta Svoboda
04cb4ddd2c Check if given partial name is also file or only folder (#3190)
Fixes #2383. Credit to @vojtasvoboda, reviewed by @CptMeatball
2017-10-23 08:48:34 -06:00
Samuel Georges
c0aa03a400 Create an error making trait
Widgets can throw fatal errors too
2017-06-11 22:38:03 +10:00
Samuel Georges
f3de51e992 Add backend and notifications settings category
URL -> url
Move mail settings below mail templates
2017-06-05 17:36:44 +10:00
Luke Towers
68e874dc97 AssetMaker Improvements (#2847)
* Check if asset file exists before symbolizing path

Adds a check to see if the asset file exists before attempting to symbolize it, this will allow the asset combiner to be passed assets with complete paths instead of only relative paths.

* Implement combiner business logic

* Improve handling of bad inputs
2017-04-27 00:17:05 -06:00
Quezler
cc17b679f1 Code dusting (#2826)
Code cleaning according to PSR-2 w/ exemptions (mostly dust).
2017-04-24 21:38:19 +10:00
Samuel Georges
96d0ce1c20 Add mergeConfig helper, useful for extension
Refs 8575ece07d
2017-04-17 09:55:50 +10:00