File size: 2,992 Bytes
4d2a9bf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 62ea2c52f9..4d9f41776a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
 The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
 and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
 
+## 9.4.4 - 2020-10-19
+
+### Fixed
+- Escape inline attributes [#1313](https://github.com/orchidsoftware/platform/pull/1313)
+
 ## 9.4.3 - 2020-10-17
 
 ### Changed
diff --git a/src/Platform/Dashboard.php b/src/Platform/Dashboard.php
index 9f8c926a69..d81d6c61bc 100644
--- a/src/Platform/Dashboard.php
+++ b/src/Platform/Dashboard.php
@@ -17,7 +17,7 @@ class Dashboard
     /**
      * ORCHID Version.
      */
-    public const VERSION = '9.4.3';
+    public const VERSION = '9.4.4';
 
     /**
      * The Dashboard configuration options.
diff --git a/src/Screen/Field.php b/src/Screen/Field.php
index 4d74e86010..e705ce4d7b 100644
--- a/src/Screen/Field.php
+++ b/src/Screen/Field.php
@@ -245,11 +245,13 @@ protected function getAllowAttributes(): ComponentAttributeBag
     {
         $allow = array_merge($this->universalAttributes, $this->inlineAttributes);
 
-        $attribute = new ComponentAttributeBag($this->getAttributes());
+        $attributes = collect($this->getAttributes())
+            ->filter(function ($value, $attribute) use ($allow) {
+                return Str::is($allow, $attribute);
+            })->toArray();
 
-        return $attribute->filter(function ($value, $attribute) use ($allow) {
-            return Str::is($allow, $attribute);
-        });
+        return (new ComponentAttributeBag())
+            ->merge($attributes);
     }
 
     /**
diff --git a/src/Screen/Fields/Upload.php b/src/Screen/Fields/Upload.php
index 33389b34e1..4e09b0fbd1 100644
--- a/src/Screen/Fields/Upload.php
+++ b/src/Screen/Fields/Upload.php
@@ -81,7 +81,6 @@ class Upload extends Field
         'multiple',
         'placeholder',
         'required',
-        'value',
         'groups',
         'storage',
         'media',
diff --git a/tests/Unit/Screen/Fields/InputTest.php b/tests/Unit/Screen/Fields/InputTest.php
index 32f55201ca..91571ad1d4 100644
--- a/tests/Unit/Screen/Fields/InputTest.php
+++ b/tests/Unit/Screen/Fields/InputTest.php
@@ -68,4 +68,18 @@ public function testDataAttributes(): void
         $this->assertStringContainsString('data-location="Russia"', $input);
         $this->assertStringContainsString('data-hello="world!"', $input);
     }
+
+    public function testEscapeAttributes(): void
+    {
+        $input = (string) Input::make('name')->value('valueQuote"');
+
+        $this->assertStringContainsString('value="valueQuote""', $input);
+    }
+
+    public function testRemoveBooleanAttributes(): void
+    {
+        $input = (string) Input::make('name')->required(false);
+
+        $this->assertStringNotContainsString('required', $input);
+    }
 }