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 11<?php
22/**
3- * Copyright © Magento, Inc. All rights reserved.
4- * See COPYING.txt for license details .
3+ * Copyright 2014 Adobe
4+ * All Rights Reserved .
55 */
66namespace Magento \CheckoutAgreements \Model ;
77
@@ -96,11 +96,14 @@ protected function getAgreementsConfig()
9696 $ agreementConfiguration ['isEnabled ' ] = (bool )($ isAgreementsEnabled && count ($ agreementsList ) > 0 );
9797
9898 foreach ($ agreementsList as $ agreement ) {
99+ $ isAgreementHtmlType = $ agreement ->getIsHtml ();
99100 $ agreementConfiguration ['agreements ' ][] = [
100- 'content ' => $ agreement -> getIsHtml ()
101+ 'content ' => $ isAgreementHtmlType
101102 ? $ agreement ->getContent ()
102103 : 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 ())),
104107 'mode ' => $ agreement ->getMode (),
105108 'agreementId ' => $ agreement ->getAgreementId (),
106109 'contentHeight ' => $ agreement ->getContentHeight ()
Original file line number Diff line number Diff line change 11<?php
22/**
3- * Copyright © Magento, Inc. All rights reserved.
4- * See COPYING.txt for license details .
3+ * Copyright 2014 Adobe
4+ * All Rights Reserved .
55 */
66declare (strict_types=1 );
77
@@ -88,7 +88,6 @@ public function testGetConfigIfContentIsHtml(): void
8888 {
8989 $ content = 'content ' ;
9090 $ checkboxText = 'checkbox_text ' ;
91- $ escapedCheckboxText = 'escaped_checkbox_text ' ;
9291 $ mode = AgreementModeOptions::MODE_AUTO ;
9392 $ agreementId = 100 ;
9493 $ contentHeight = '100px ' ;
@@ -98,7 +97,7 @@ public function testGetConfigIfContentIsHtml(): void
9897 'agreements ' => [
9998 [
10099 'content ' => $ content ,
101- 'checkboxText ' => $ escapedCheckboxText ,
100+ 'checkboxText ' => $ checkboxText ,
102101 'mode ' => $ mode ,
103102 'agreementId ' => $ agreementId ,
104103 'contentHeight ' => $ contentHeight
@@ -122,11 +121,6 @@ public function testGetConfigIfContentIsHtml(): void
122121 ->with ($ searchCriteriaMock )
123122 ->willReturn ([$ agreement ]);
124123
125- $ this ->escaperMock ->expects ($ this ->once ())
126- ->method ('escapeHtml ' )
127- ->with ($ checkboxText )
128- ->willReturn ($ escapedCheckboxText );
129-
130124 $ agreement ->expects ($ this ->once ())->method ('getIsHtml ' )->willReturn (true );
131125 $ agreement ->expects ($ this ->once ())->method ('getContent ' )->willReturn ($ content );
132126 $ agreement ->expects ($ this ->once ())->method ('getCheckboxText ' )->willReturn ($ checkboxText );
You can’t perform that action at this time.
0 commit comments