Download tasks/3b197081bc368aaa/levels/level3/patch.diff from FuCY/php: direct link, hf CLI and curl.
- Browser
- Download file 2.99 kB
-
https://huggingface.co/datasets/FuCY/php/resolve/main/tasks/3b197081bc368aaa/levels/level3/patch.diff
- Command line
-
hf download hf://datasets/FuCY/php/tasks/3b197081bc368aaa/levels/level3/patch.diff
-
curl -L -o patch.diff https://huggingface.co/datasets/FuCY/php/resolve/main/tasks/3b197081bc368aaa/levels/level3/patch.diff
2.99 kB
| diff --git a/CHANGELOG.md b/CHANGELOG.md | |
| index 62ea2c52f9..4d9f41776a 100644 | |
| --- a/CHANGELOG.md | |
| +++ b/CHANGELOG.md | |
| 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 | |
| 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 | |
| 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 | |
| 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 | |
| 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); | |
| + } | |
| } | |