- Issue created by @andypost
- Status changed to Needs review
over 1 year ago 7:21pm 12 June 2023 - last update
over 1 year ago 29,442 pass - π«π·France andypost
Other files are not affected, script to check
find core -name '*.php' -exec php -l {} \; >/dev/null
- last update
over 1 year ago CI aborted - π«π·France andypost
Baseline test runs
- 10.1 https://www.drupal.org/pift-ci-job/2691058 β
- 11.0 https://www.drupal.org/pift-ci-job/2691057 β - π«π·France andypost
Only 2 tests failed comparing to 118 in base run
Test 'Drupal\Tests\filter\Kernel\FilterKernelTest::testCaptionFilter' ended Failed asserting that two strings are identical. Expected :'<img data-caption="This is a <a href="https://www.drupal.org">quick</a> testβ¦" src="llama.jpg" />' Actual :'<img data-caption="This is a &lt;a href=&quot;https://www.drupal.org&quot;&gt;quick&lt;/a&gt; testβ¦" src="llama.jpg" />'
which means
&
escaped twiceTest 'Drupal\Tests\editor\Unit\EditorXssFilter\StandardTest::testFilterXss with data set #190 ('<img src="butterfly.jpg" data...t;" />', '<img src="butterfly.jpg" data...t;" />')' ended Failed asserting that two strings are identical. Expected :'<img src="butterfly.jpg" data-caption="&lt;script&gt;alert();&lt;/script&gt;" />' Actual :'<img src="butterfly.jpg" data-caption="&amp;lt;script&amp;gt;alert();&amp;lt;/script&amp;gt;" />'
the same
- last update
over 1 year ago CI aborted - last update
over 1 year ago CI aborted - Status changed to RTBC
over 1 year ago 12:29pm 14 June 2023 - π¬π§United Kingdom longwave UK
Looks OK to me.
I did wonder if we should just change the return types here, and perhaps make the class final, but that can be done in a followup so we can discuss it.
- Status changed to Fixed
over 1 year ago 12:55pm 14 June 2023 - π¬π§United Kingdom catch
Committed/pushed to 11.x and 10.1.x, thanks!
- π«π·France andypost
@longwave Sadly we can't add
true
type hint as it was added in 8.2 https://wiki.php.net/rfc/true-type - π«π·France andypost
Example of using
bool
on 8.1/srv # php -v PHP 8.1.20 (cli) (built: Jun 7 2023 09:47:40) (NTS) Copyright (c) The PHP Group Zend Engine v4.1.20, Copyright (c) Zend Technologies with Zend OPcache v8.1.20, Copyright (c), by Zend Technologies /srv # php core/modules/jsonapi/src/Normalizer/Value/TemporaryArrayObjectThrowingExceptions.php PHP Fatal error: Cannot use 'Drupal\jsonapi\Normalizer\Value\true' as class name as it is reserved in /srv/core/modules/jsonapi/src/Normalizer/Value/TemporaryArrayObjectThrowingExceptions.php on line 158 Fatal error: Cannot use 'Drupal\jsonapi\Normalizer\Value\true' as class name as it is reserved in /srv/core/modules/jsonapi/src/Normalizer/Value/TemporaryArrayObjectThrowingExceptions.php on line 158
- Status changed to Needs review
over 1 year ago 6:47pm 14 June 2023 - Status changed to Fixed
over 1 year ago 6:48pm 14 June 2023 - π¬π§United Kingdom longwave UK
Ahh thanks @andypost, I did not know that true was only PHP 8.2+.
Automatically closed - issue fixed for 2 weeks with no activity.