File tree Expand file tree Collapse file tree 2 files changed +37
-3
lines changed
Expand file tree Collapse file tree 2 files changed +37
-3
lines changed Original file line number Diff line number Diff line change @@ -51,8 +51,14 @@ public function ajaxEnabled($storeId = null)
5151 */
5252 public function getLayerConfiguration ($ filters )
5353 {
54- $ filterParams = $ this ->_getRequest ()->getParams ();
55-
54+ $ params = $ this ->_getRequest ()->getParams ();
55+ $ filterParams = [];
56+ foreach ($ params as $ key => $ param ) {
57+ if ($ key === 'amp;dimbaar ' ) {
58+ continue ;
59+ }
60+ $ filterParams [$ this ->escapeJs (htmlentities ($ key ))] = $ this ->escapeJs (htmlentities ($ param ));
61+ }
5662 $ config = new DataObject ([
5763 'active ' => array_keys ($ filterParams ),
5864 'params ' => $ filterParams ,
@@ -61,4 +67,32 @@ public function getLayerConfiguration($filters)
6167
6268 return self ::jsonEncode ($ config ->getData ());
6369 }
70+
71+ /**
72+ * from Magento Core
73+ *
74+ * @param string $string
75+ *
76+ * @return string|null
77+ */
78+ public function escapeJs ($ string )
79+ {
80+ if ($ string === '' || ctype_digit ($ string )) {
81+ return $ string ;
82+ }
83+
84+ return preg_replace_callback (
85+ '/[^a-z0-9,\._]/iSu ' ,
86+ function ($ matches ) {
87+ $ chr = $ matches [0 ];
88+ if (strlen ($ chr ) != 1 ) {
89+ $ chr = mb_convert_encoding ($ chr , 'UTF-16BE ' , 'UTF-8 ' );
90+ $ chr = ($ chr === false ) ? '' : $ chr ;
91+ }
92+
93+ return sprintf ('\\u%04s ' , strtoupper (bin2hex ($ chr )));
94+ },
95+ $ string
96+ );
97+ }
6498}
Original file line number Diff line number Diff line change 55 "mageplaza/module-core" : " ^1.4.5"
66 },
77 "type" : " magento2-module" ,
8- "version" : " 4.0 .0" ,
8+ "version" : " 4.1 .0" ,
99 "license" : " proprietary" ,
1010 "authors" : [
1111 {
You can’t perform that action at this time.
0 commit comments