diff --git a/docs/en/02_Developer_Guides/04_Configuration/00_Configuration.md b/docs/en/02_Developer_Guides/04_Configuration/00_Configuration.md index 345dde7c2..98d9438e5 100644 --- a/docs/en/02_Developer_Guides/04_Configuration/00_Configuration.md +++ b/docs/en/02_Developer_Guides/04_Configuration/00_Configuration.md @@ -168,12 +168,12 @@ the result will be the higher priority false-ish value. The locations that configuration values are taken from in highest -> lowest priority order are: -- Any values set via a call to Config#merge / Config#set +- Runtime modifications, ie: any values set via a call to `Config::inst()->update()` - The configuration values taken from the YAML files in `_config/` directories (internally sorted in before / after order, where the item that is latest is highest priority) -- Any static set on an "additional static source" class (such as an extension) named the same as the name of the property - Any static set on the class named the same as the name of the property - The composite configuration value of the parent class of this class +- Any static set on an "additional static source" class (such as an extension) named the same as the name of the property
The password reset link is invalid or expired.
You can request a new one here or change your password after you logged in.
' NOTERESETPASSWORD: 'Enter your e-mail address and we will send you a link with which you can reset your password' - PASSWORDSENTHEADER: 'Password reset link sent to ''{email}''' - PASSWORDSENTTEXT: 'Thank you! A reset link has been sent to ''{email}'', provided an account exists for this email address.' + PASSWORDRESETSENTHEADER: 'Password reset link sent' + PASSWORDRESETSENTTEXT: 'Thank you. A reset link has been sent, provided an account exists for this email address.' diff --git a/src/Control/Middleware/HTTPCacheControlMiddleware.php b/src/Control/Middleware/HTTPCacheControlMiddleware.php index 13608d5e2..572e6fb2b 100644 --- a/src/Control/Middleware/HTTPCacheControlMiddleware.php +++ b/src/Control/Middleware/HTTPCacheControlMiddleware.php @@ -103,7 +103,7 @@ class HTTPCacheControlMiddleware implements HTTPMiddleware, Resettable * @config * @var string */ - protected static $defaultState = self::STATE_DEFAULT; + private static $defaultState = self::STATE_DEFAULT; /** * Current state @@ -771,14 +771,9 @@ class HTTPCacheControlMiddleware implements HTTPMiddleware, Resettable } // Errors disable cache (unless some errors are cached intentionally by usercode) - if ($response->isError()) { + if ($response->isError() || $response->isRedirect()) { // Even if publicCache(true) is specified, errors will be uncacheable $this->disableCache(true); } - - // Don't cache redirects - if ($response->isRedirect()) { - $this->disableCache(true); - } } } diff --git a/src/Core/Config/Middleware/ExtensionMiddleware.php b/src/Core/Config/Middleware/ExtensionMiddleware.php index 3edbc5b0d..a79eaa44d 100644 --- a/src/Core/Config/Middleware/ExtensionMiddleware.php +++ b/src/Core/Config/Middleware/ExtensionMiddleware.php @@ -39,7 +39,7 @@ class ExtensionMiddleware implements Middleware } foreach ($this->getExtraConfig($class, $config, $excludeMiddleware) as $extra) { - $config = Priority::mergeArray($extra, $config); + $config = Priority::mergeArray($config, $extra); } return $config; } diff --git a/src/Security/MemberAuthenticator/LostPasswordHandler.php b/src/Security/MemberAuthenticator/LostPasswordHandler.php index 5086e525c..dfd8aeebc 100644 --- a/src/Security/MemberAuthenticator/LostPasswordHandler.php +++ b/src/Security/MemberAuthenticator/LostPasswordHandler.php @@ -27,8 +27,8 @@ class LostPasswordHandler extends RequestHandler * @var array */ private static $url_handlers = [ - 'passwordsent/$EmailAddress' => 'passwordsent', - '' => 'lostpassword', + 'passwordsent' => 'passwordsent', + '' => 'lostpassword', ]; /** @@ -101,27 +101,17 @@ class LostPasswordHandler extends RequestHandler */ public function passwordsent() { - $request = $this->getRequest(); - $email = Convert::raw2xml(rawurldecode($request->param('EmailAddress'))); - if ($request->getExtension()) { - $email = $email . '.' . Convert::raw2xml($request->getExtension()); - } - $message = _t( - 'SilverStripe\\Security\\Security.PASSWORDSENTTEXT', - "Thank you! A reset link has been sent to '{email}', provided an account exists for this email" - . " address.", - ['email' => Convert::raw2xml($email)] + 'SilverStripe\\Security\\Security.PASSWORDRESETSENTTEXT', + "Thank you. A reset link has been sent, provided an account exists for this email address." ); return [ - 'Title' => _t( - 'SilverStripe\\Security\\Security.PASSWORDSENTHEADER', - "Password reset link sent to '{email}'", - array('email' => $email) + 'Title' => _t( + 'SilverStripe\\Security\\Security.PASSWORDRESETSENTHEADER', + "Password reset link sent" ), 'Content' => DBField::create_field('HTMLFragment', "$message
"), - 'Email' => $email ]; } @@ -263,11 +253,7 @@ class LostPasswordHandler extends RequestHandler */ protected function redirectToSuccess(array $data) { - $link = Controller::join_links( - $this->Link('passwordsent'), - rawurlencode($data['Email']), - '/' - ); + $link = $this->link('passwordsent'); return $this->redirect($this->addBackURLParam($link)); } diff --git a/src/View/Shortcodes/EmbedShortcodeProvider.php b/src/View/Shortcodes/EmbedShortcodeProvider.php index f0fe6bd63..62f23fec2 100644 --- a/src/View/Shortcodes/EmbedShortcodeProvider.php +++ b/src/View/Shortcodes/EmbedShortcodeProvider.php @@ -2,6 +2,7 @@ namespace SilverStripe\View\Shortcodes; +use Embed\Http\DispatcherInterface; use SilverStripe\Core\Convert; use SilverStripe\Core\Injector\Injector; use SilverStripe\View\Embed\Embeddable; @@ -76,6 +77,11 @@ class EmbedShortcodeProvider implements ShortcodeHandler $serviceURL, $extra['resolver']['config'] ); + } elseif (Injector::inst()->has(DispatcherInterface::class)) { + $dispatcher = Injector::inst()->get(DispatcherInterface::class); + } + + if ($dispatcher) { $embed->setDispatcher($dispatcher); } diff --git a/tests/php/ORM/DataObjectTest.php b/tests/php/ORM/DataObjectTest.php index 7a9422abf..c0d81c15f 100644 --- a/tests/php/ORM/DataObjectTest.php +++ b/tests/php/ORM/DataObjectTest.php @@ -1102,72 +1102,88 @@ class DataObjectTest extends SapphireTest // Test logical fields (including composite) $teamSpecifications = $schema->fieldSpecs(DataObjectTest\Team::class); + $expected = array( + 'ID', + 'ClassName', + 'LastEdited', + 'Created', + 'Title', + 'DatabaseField', + 'ExtendedDatabaseField', + 'CaptainID', + 'FounderID', + 'HasOneRelationshipID', + 'ExtendedHasOneRelationshipID' + ); + $actual = array_keys($teamSpecifications); + sort($expected); + sort($actual); $this->assertEquals( - array( - 'ID', - 'ClassName', - 'LastEdited', - 'Created', - 'Title', - 'DatabaseField', - 'ExtendedDatabaseField', - 'CaptainID', - 'FounderID', - 'HasOneRelationshipID', - 'ExtendedHasOneRelationshipID' - ), - array_keys($teamSpecifications), + $expected, + $actual, 'fieldSpecifications() contains all fields defined on instance: base, extended and foreign keys' ); $teamFields = $schema->databaseFields(DataObjectTest\Team::class, false); + $expected = array( + 'ID', + 'ClassName', + 'LastEdited', + 'Created', + 'Title', + 'DatabaseField', + 'ExtendedDatabaseField', + 'CaptainID', + 'FounderID', + 'HasOneRelationshipID', + 'ExtendedHasOneRelationshipID' + ); + $actual = array_keys($teamFields); + sort($expected); + sort($actual); $this->assertEquals( - array( - 'ID', - 'ClassName', - 'LastEdited', - 'Created', - 'Title', - 'DatabaseField', - 'ExtendedDatabaseField', - 'CaptainID', - 'FounderID', - 'HasOneRelationshipID', - 'ExtendedHasOneRelationshipID' - ), - array_keys($teamFields), + $expected, + $actual, 'databaseFields() contains only fields defined on instance, including base, extended and foreign keys' ); $subteamSpecifications = $schema->fieldSpecs(DataObjectTest\SubTeam::class); + $expected = array( + 'ID', + 'ClassName', + 'LastEdited', + 'Created', + 'Title', + 'DatabaseField', + 'ExtendedDatabaseField', + 'CaptainID', + 'FounderID', + 'HasOneRelationshipID', + 'ExtendedHasOneRelationshipID', + 'SubclassDatabaseField', + 'ParentTeamID', + ); + $actual = array_keys($subteamSpecifications); + sort($expected); + sort($actual); $this->assertEquals( - array( - 'ID', - 'ClassName', - 'LastEdited', - 'Created', - 'Title', - 'DatabaseField', - 'ExtendedDatabaseField', - 'CaptainID', - 'FounderID', - 'HasOneRelationshipID', - 'ExtendedHasOneRelationshipID', - 'SubclassDatabaseField', - 'ParentTeamID', - ), - array_keys($subteamSpecifications), + $expected, + $actual, 'fieldSpecifications() on subclass contains all fields, including base, extended and foreign keys' ); $subteamFields = $schema->databaseFields(DataObjectTest\SubTeam::class, false); + $expected = array( + 'ID', + 'SubclassDatabaseField', + 'ParentTeamID', + ); + $actual = array_keys($subteamFields); + sort($expected); + sort($actual); $this->assertEquals( - array( - 'ID', - 'SubclassDatabaseField', - 'ParentTeamID', - ), - array_keys($subteamFields), + $expected, + $actual, 'databaseFields() on subclass contains only fields defined on instance' ); } diff --git a/tests/php/Security/MemberTest.php b/tests/php/Security/MemberTest.php index 53bb4883c..942b732b0 100644 --- a/tests/php/Security/MemberTest.php +++ b/tests/php/Security/MemberTest.php @@ -239,7 +239,7 @@ class MemberTest extends FunctionalTest // We should get redirected to Security/passwordsent $this->assertContains( - 'Security/lostpassword/passwordsent/testuser@example.com', + 'Security/lostpassword/passwordsent', urldecode($response->getHeader('Location')) );