Skip to content

Commit 522f2b4

Browse files
committed
Disable bad escaping for custom file input.
1 parent ad90cb8 commit 522f2b4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/View/Helper/BootstrapFormHelper.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,8 @@ public function file($fieldName, array $options = []) {
408408
unset($options['count-label']);
409409
$fileInput = $this->widget('file', array_merge($options, [
410410
'style' => 'display: none;',
411-
'onchange' => "document.getElementById('".$options['id']."-input').value = (this.files.length <= 1) ? this.files[0].name : this.files.length + ' ' + '" . $countLabel . "';"
411+
'onchange' => "document.getElementById('".$options['id']."-input').value = (this.files.length <= 1) ? this.files[0].name : this.files.length + ' ' + '" . $countLabel . "';",
412+
'escape' => false
412413
]));
413414

414415
$fakeInputCustomOptions += [
@@ -418,7 +419,8 @@ public function file($fieldName, array $options = []) {
418419
'name' => $fieldName.'-text',
419420
'readonly' => 'readonly',
420421
'id' => $options['id'].'-input',
421-
'onclick' => "document.getElementById('".$options['id']."').click();"
422+
'onclick' => "document.getElementById('".$options['id']."').click();",
423+
'escape' => false
422424
]));
423425
$buttonLabel = $options['button-label'];
424426
unset($options['button-label']);

0 commit comments

Comments
 (0)