Commit Graph

66 Commits

Author SHA1 Message Date
Guy Sartorelli 908b6f2006
Merge branch '4.12' into 4.13 2023-04-26 11:44:54 +12:00
Guy Sartorelli 1a5bb4cbec
[CVE-2023-22729] Escaped double slash is absolute URL 2023-04-26 09:49:59 +12:00
Guy Sartorelli 5295ba6c16
API Throw deprecation warnings for bad configuration (#10702) 2023-03-01 11:36:08 +13:00
Guy Sartorelli 6669d54f59
FIX Wrap deprecated config with no replacement (#10704) 2023-02-27 18:13:31 +13:00
Steve Boyd 4e9c74243d API Deprecate code 2023-02-07 11:56:04 +13:00
Steve Boyd 137ebcebec API Stop using deprecated API 2022-11-15 18:20:54 +13:00
Steve Boyd 9c453abf89 API Update deprecations 2022-10-13 14:49:15 +13:00
Steve Boyd cc49036616 ENH Standardise deprecation messages 2022-10-13 14:05:49 +13:00
Guy Sartorelli 2411a83d5d
Merge pull request #10291 from creative-commoners/pulls/4/revert
FIX Revert adding extension hook
2022-04-26 12:00:26 +12:00
Steve Boyd 345173343c FIX Revert adding extension hook 2022-04-26 09:58:45 +12:00
Steve Boyd 511b3bb060 ENH PHP 8.1 compatibility 2022-04-14 13:12:59 +12:00
GuySartorelli fc2160fa3a
ENH Provide hook for updating the parent used for absoluteURL (#10168)
One use case for this that I've run into a few times is for sending emails using a queued job from the CLI.
2022-01-31 20:41:14 +13:00
Lukas 552cf5944d
MNT Fix various typos with codespell (#10177) 2021-12-13 21:05:33 +13:00
Michal Kleiner f8a9431152 NEW Add extension point to Director::is_site_url 2021-08-06 12:54:18 +12:00
Steve Boyd 3d7868449f Merge branch '4.7' into 4 2021-04-19 16:39:15 +12:00
Kunal Hari 31c5ab2069 [BUGFIX] Prevent call getHeader() on null HTTPRequest object 2021-04-13 14:06:21 +12:00
Loz Calver 095a3b70f8 NEW: Provide helpers for isDev/isTest/isLive in templates 2021-02-11 11:19:07 +00:00
Daniel Hensby 237b2d5f74
Convert array delcarations to short array syntax 2020-04-20 18:58:09 +01:00
Damian Mooyman 6759af3767
Escape strings a bit safer for doc generation 2019-09-03 19:38:19 +12:00
Damian Mooyman f649657182
Clarify Director::absoluteURL behaviour
Fixes #9111
2019-09-03 19:34:16 +12:00
Aaron Carlino c747b1f8d3 Merge branch '4.3' into 4.4 2019-06-10 17:32:07 +12:00
Serge Latyntcev ca56e8d78e [CVE-2019-12246] Denial of Service on flush and development URL tools 2019-06-10 17:23:56 +12:00
Loz Calver ca781c684d FIX: RequestHandler::__construct() should run after middlewares (fixes #8848) 2019-03-11 11:08:03 +00:00
Robbie Averill e211e27470 Add more unit tests for DebugViewFriendlyErrorFormatter, tidy up Director::is_ajax() return 2018-10-20 14:27:57 +02:00
Daniel Hensby ae00147de1
Merge pull request #8280 from open-sausages/pulls/4/simpler-vary-header
FIX: Remove X-Requested-With from default Vary header
2018-07-24 01:45:07 +01:00
Sam Minnee bde3121a33
FIX: Remove X-Requested-With from default Vary header
3.x forward port of https://github.com/silverstripe/silverstripe-framework/pull/8242
2018-07-23 14:18:05 +01:00
Ingo Schommer 74b655d3fc
Fix tests on unset session data
Thanks Robbie!
2018-07-23 14:09:42 +01:00
Damian Mooyman 76bf2ab21a WIP of cache middlware 2018-06-13 11:33:45 +12:00
Robbie Averill 722202fef4 Merge remote-tracking branch 'origin/4.0.4' into 4.1.1
# Conflicts:
  #	src/Control/Director.php
2018-05-24 15:41:11 +12:00
Damian Mooyman 5bff64b47b BUG Fix Director::test() not persisting removed session keys on teardown 2018-05-24 13:10:03 +12:00
Damian Mooyman 9053014a7e [ss-2018-008] Validate against malformed urls 2018-05-14 17:06:47 +12:00
Damian Mooyman 2225cf4c95
BUG Fix Director::test() not persisting removed session keys on teardown 2018-02-07 11:03:32 +13:00
Damian Mooyman 04050b2753 API Director::host() now formally includes port in host
API Add Director::hostName() and Director::port()
Fixes #7685
2018-01-23 12:19:09 +13:00
Damian Mooyman 8d077203d4 API Implement support for public/ webroot folder (#7741)
* API Implement support for public/ webroot folder

* Bugfixes and refactor based on feedback
2018-01-12 16:25:02 +13:00
Damian Mooyman c5bd9bb424
BUG Fix incorrect BASE_DIR inferred in CLI
BUG Fix Director::mockRequest() mocking incorrect $url
Fixes #7689
2017-12-15 17:20:48 +13:00
Damian Mooyman 9d3277f3d3
BUG Fix forceWWW and forceSSL not working in _config.php
API Introduce CanonicalURLMiddleware
BUG Fix Director::makeRelative() failing on multi-domain sites
2017-10-30 14:42:36 +13:00
Ingo Schommer bd11bc16c7 Avoid double slash in Director mock URLs
They get faulty results when run through parse_url($url, PHP_URL_PATH)
which we started using in HTTPRequestBuilder
2017-10-09 17:21:43 +13:00
Ingo Schommer 64af679c35 DOCS Corrected env type docs (fixes #7290) 2017-08-30 08:35:41 +12:00
Damian Mooyman 9b4d689bb2 Lazy-load custom methods and extensions on CustomMethods and Extensible traits
No longer need constructExtensions()
2017-08-22 15:47:24 +12:00
Robbie Averill 392cda15f6 NEW Add updateRules extension point to Director::handleRequest 2017-07-23 22:10:46 +12:00
Robbie Averill ea4181166f FIX Ensure phpdbg calls are registered by SilverStripe core as a CLI call 2017-07-17 16:56:01 +12:00
Damian Mooyman f65e3627dc
BUG Implement or exclude all pending upgrader deltas 2017-07-03 12:21:47 +12:00
Damian Mooyman f699650b5f Update based on feedback 2017-06-27 13:32:39 +12:00
Damian Mooyman d20ab50f9d API Stronger Injector service unregistration
BUG Fix up test regressions
FIX director references to request object
API Move all middlewares to common namespace
API Implement RequestHandlerMiddlewareAdapter
ENHANCEMENT Improve IP address parsing
Fix up PHPDoc / psr2 linting
BUG Fix property parsing in TrustedProxyMiddleware
BUG Fix Director::is_https()
2017-06-27 13:32:39 +12:00
Sam Minnee 69fe166897 API: Director::handleRequest() is no longer static - use a Director service
NEW: Add HTMLMiddlewareAware trait to HTTPApplication, Director, and RequestHandler
NEW: Allow service specs to be passed to Director rules.

This refactor of the controller middlewares takes a service definition
approach rather than a static-method-and-config approach that Director
historically had.

The use of a trait for middleware means that the Middlewares array
property can be defined on RequestHandler, Director, and HTTPApplication
objects in the same way.
2017-06-27 13:32:39 +12:00
Sam Minnee e92c63c545 API: Remove $sid argument of Session::start()
NEW: Pass HTTPRequest to session
NEW: Pass HTTPReuqest optionally to Director statics

The session handler now expects to operate on a specific
HTTPRequest object.
2017-06-27 13:32:39 +12:00
Sam Minnee ccc86306b6 NEW: Add TrustedProxyMiddleware
API: SS_TRUSTED_PROXY_HOST_HEADER replace with middleware config
API: SS_TRUSTED_PROXY_PROTOCOL_HEADER replace with middleware config
API: SS_TRUSTED_PROXY_IP_HEADER replace with middleware config
API: Front-End-Https = “on” header no longer supported

This middleware replaces the TRUSTED_PROXY setting and shifts its
configuration out of the env vars and bootstrap and into the Director
flow.
2017-06-27 13:32:39 +12:00
Sam Minnee 4d89daac78 NEW: Register Injector::inst()->get(HTTPRequest)
HTTPRequest is provided as a service so that global references for
session, hostname, etc can be facilitated. It’s a bit of a hack and
should be avoided but we’re unlikely to scrub it completely from the
Silverstripe 4 code.
2017-06-27 13:32:39 +12:00
Sam Minnee 10866c0809 API: Replace Director::direct() with Director::handleRequest().
There was no longer any code in direct() and so I opted to expose the
handleRequest() method instead.
2017-06-27 13:32:39 +12:00
Sam Minnee 72a7655e95 NEW: Moved allowed-hosts checking to a middleware. 2017-06-27 13:32:39 +12:00