-
Notifications
You must be signed in to change notification settings - Fork 680
Fix dictionary for strip_tags #8729
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix dictionary for strip_tags #8729
Conversation
- allow null - allow array from PHP 7.4 (see https://www.php.net/manual/en/function.strip-tags.php) https://3v4l.org/VjbXO https://3v4l.org/VWsPr
dictionaries/CallMap_74_delta.php
Outdated
@@ -45,6 +45,10 @@ | |||
'old' => ['resource|false', 'command'=>'string', 'descriptor_spec'=>'array', '&pipes'=>'resource[]', 'cwd='=>'?string', 'env_vars='=>'?array', 'options='=>'?array'], | |||
'new' => ['resource|false', 'command'=>'string|array', 'descriptor_spec'=>'array', '&pipes'=>'resource[]', 'cwd='=>'?string', 'env_vars='=>'?array', 'options='=>'?array'], | |||
], | |||
'strip_tags' => [ | |||
'old' => ['string', 'string'=>'string', 'allowed_tags='=>'?string'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I understand it, null was not accepted prior to PHP 8.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also found this information in documentation. But I also checked on PHP 7.2 - it also works with null
: https://3v4l.org/nkHYY#v7.2.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but that's because of undefined behaviour. Just because it used to work doesn't mean that it was designed like that or that it should be used this way.
Arrays worked too https://3v4l.org/PE5hP#v7.2.0 and so did booleans https://3v4l.org/qoDFT#v7.2.0
Even with strict types, you could pass anything you'd like https://3v4l.org/mJvL3#v7.2.0 That's why in PHP 8.0 and 8.1 this behaviour was fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kamil-tekiela
thanks a lot, should be fixed by d33c338
Thanks for that! Two changes:
|
that's great news! Are you going to merge changed from 4.x to 5.x (made after 5.x branch off)?
done
done |
If I'm not mistaken, we did already :) The only thing left to do would be to make a (last?) release from 4.x because some PR were merged after the latest release. We can do that even after a Psalm 5 release though so no emergency! |
Thanks! |
@orklah |
I made one. We should have released a few days ago already so I didn't bother but as we took some more time, We might as well make one |
Changes:
$allowed_tags
from PHP 8.0 (see docs)$allowed_tags
from PHP 7.4 (see docs)Proofs: