File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
lib/internal/Magento/Framework/Convert Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -134,6 +134,19 @@ protected function _getXmlRow($row, $useCallback)
134
134
$ value = htmlspecialchars ($ value );
135
135
$ dataType = is_numeric ($ value ) && $ value [0 ] !== '+ ' && $ value [0 ] !== '0 ' ? 'Number ' : 'String ' ;
136
136
137
+ /**
138
+ * Security enhancement for CSV data processing by Excel-like applications.
139
+ * @see https://bugzilla.mozilla.org/show_bug.cgi?id=1054702
140
+ *
141
+ * @var $value string|\Magento\Framework\Phrase
142
+ */
143
+ if (!is_string ($ value )) {
144
+ $ value = (string )$ value ;
145
+ }
146
+ if (isset ($ value [0 ]) && in_array ($ value [0 ], ['= ' , '+ ' , '- ' ])) {
147
+ $ value = ' ' . $ value ;
148
+ }
149
+
137
150
$ value = str_replace ("\r\n" , ' ' , $ value );
138
151
$ value = str_replace ("\r" , ' ' , $ value );
139
152
$ value = str_replace ("\n" , ' ' , $ value );
You can’t perform that action at this time.
0 commit comments