From 79e8a6ea435c9b325cb4293fefc810bad109d33a Mon Sep 17 00:00:00 2001 From: Kiryl Poyu Date: Fri, 11 Mar 2022 17:13:05 +0100 Subject: [PATCH 1/2] fix: wrap `lti message` form auto submit to `window.onload` callback --- src/Message/LtiMessage.php | 5 ++++- tests/Unit/Message/LtiMessageTest.php | 2 +- .../Oidc/Server/OidcAuthenticationRequestHandlerTest.php | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Message/LtiMessage.php b/src/Message/LtiMessage.php index 1eff7d6..6d7aff7 100644 --- a/src/Message/LtiMessage.php +++ b/src/Message/LtiMessage.php @@ -105,7 +105,10 @@ public function toHtmlRedirectForm(bool $autoSubmit = true): string $formInputs[] = sprintf('', $name, $value); } - $autoSubmitScript = sprintf('', $formId); + $autoSubmitScript = sprintf( + '', + $formId + ); return sprintf( '
%s
%s', diff --git a/tests/Unit/Message/LtiMessageTest.php b/tests/Unit/Message/LtiMessageTest.php index 4c50cad..6eb179a 100644 --- a/tests/Unit/Message/LtiMessageTest.php +++ b/tests/Unit/Message/LtiMessageTest.php @@ -143,7 +143,7 @@ public function testToHtmlLink(): void public function testToHtmlRedirectForm(): void { $this->assertEquals( - '
', + '
', $this->subject->toHtmlRedirectForm() ); } diff --git a/tests/Unit/Security/Oidc/Server/OidcAuthenticationRequestHandlerTest.php b/tests/Unit/Security/Oidc/Server/OidcAuthenticationRequestHandlerTest.php index a866863..6871bc1 100644 --- a/tests/Unit/Security/Oidc/Server/OidcAuthenticationRequestHandlerTest.php +++ b/tests/Unit/Security/Oidc/Server/OidcAuthenticationRequestHandlerTest.php @@ -65,7 +65,7 @@ public function testAuthenticationSuccessResponse(): void $this->assertEquals(200, $response->getStatusCode()); $this->assertEquals( - '
', + '
', (string)$response->getBody() ); } From fa17550b9725756e36d3941973f006e46dba628c Mon Sep 17 00:00:00 2001 From: Kiryl Poyu Date: Sat, 12 Mar 2022 16:30:42 +0100 Subject: [PATCH 2/2] doc: Changelog updated --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8abd6a..c74d963 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +6.7.1 +----- + +* `LtiMessage` auto submit script wrapped by `window.onload` callback + 6.7.0 -----