File tree Expand file tree Collapse file tree 2 files changed +10
-13
lines changed
app/code/Magento/CheckoutAgreements Expand file tree Collapse file tree 2 files changed +10
-13
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- * Copyright © Magento, Inc. All rights reserved.
4
- * See COPYING.txt for license details .
3
+ * Copyright 2014 Adobe
4
+ * All Rights Reserved .
5
5
*/
6
6
namespace Magento \CheckoutAgreements \Model ;
7
7
@@ -96,11 +96,14 @@ protected function getAgreementsConfig()
96
96
$ agreementConfiguration ['isEnabled ' ] = (bool )($ isAgreementsEnabled && count ($ agreementsList ) > 0 );
97
97
98
98
foreach ($ agreementsList as $ agreement ) {
99
+ $ isAgreementHtmlType = $ agreement ->getIsHtml ();
99
100
$ agreementConfiguration ['agreements ' ][] = [
100
- 'content ' => $ agreement -> getIsHtml ()
101
+ 'content ' => $ isAgreementHtmlType
101
102
? $ agreement ->getContent ()
102
103
: nl2br ($ this ->escaper ->escapeHtml ($ agreement ->getContent ())),
103
- 'checkboxText ' => $ this ->escaper ->escapeHtml ($ agreement ->getCheckboxText ()),
104
+ 'checkboxText ' => $ isAgreementHtmlType
105
+ ? $ agreement ->getCheckboxText ()
106
+ : nl2br ($ this ->escaper ->escapeHtml ($ agreement ->getCheckboxText ())),
104
107
'mode ' => $ agreement ->getMode (),
105
108
'agreementId ' => $ agreement ->getAgreementId (),
106
109
'contentHeight ' => $ agreement ->getContentHeight ()
Original file line number Diff line number Diff line change 1
1
<?php
2
2
/**
3
- * Copyright © Magento, Inc. All rights reserved.
4
- * See COPYING.txt for license details .
3
+ * Copyright 2014 Adobe
4
+ * All Rights Reserved .
5
5
*/
6
6
declare (strict_types=1 );
7
7
@@ -88,7 +88,6 @@ public function testGetConfigIfContentIsHtml(): void
88
88
{
89
89
$ content = 'content ' ;
90
90
$ checkboxText = 'checkbox_text ' ;
91
- $ escapedCheckboxText = 'escaped_checkbox_text ' ;
92
91
$ mode = AgreementModeOptions::MODE_AUTO ;
93
92
$ agreementId = 100 ;
94
93
$ contentHeight = '100px ' ;
@@ -98,7 +97,7 @@ public function testGetConfigIfContentIsHtml(): void
98
97
'agreements ' => [
99
98
[
100
99
'content ' => $ content ,
101
- 'checkboxText ' => $ escapedCheckboxText ,
100
+ 'checkboxText ' => $ checkboxText ,
102
101
'mode ' => $ mode ,
103
102
'agreementId ' => $ agreementId ,
104
103
'contentHeight ' => $ contentHeight
@@ -122,11 +121,6 @@ public function testGetConfigIfContentIsHtml(): void
122
121
->with ($ searchCriteriaMock )
123
122
->willReturn ([$ agreement ]);
124
123
125
- $ this ->escaperMock ->expects ($ this ->once ())
126
- ->method ('escapeHtml ' )
127
- ->with ($ checkboxText )
128
- ->willReturn ($ escapedCheckboxText );
129
-
130
124
$ agreement ->expects ($ this ->once ())->method ('getIsHtml ' )->willReturn (true );
131
125
$ agreement ->expects ($ this ->once ())->method ('getContent ' )->willReturn ($ content );
132
126
$ agreement ->expects ($ this ->once ())->method ('getCheckboxText ' )->willReturn ($ checkboxText );
You can’t perform that action at this time.
0 commit comments