Skip to content
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

Merged
merged 3 commits into from Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion dictionaries/CallMap.php
Expand Up @@ -13907,7 +13907,7 @@
'streamWrapper::unlink' => ['bool', 'path'=>'string'],
'streamWrapper::url_stat' => ['array', 'path'=>'string', 'flags'=>'int'],
'strftime' => ['string|false', 'format'=>'string', 'timestamp='=>'?int'],
'strip_tags' => ['string', 'string'=>'string', 'allowed_tags='=>'string'],
'strip_tags' => ['string', 'string'=>'string', 'allowed_tags='=>'?string'],
'stripcslashes' => ['string', 'string'=>'string'],
'stripos' => ['int|false', 'haystack'=>'string', 'needle'=>'string', 'offset='=>'int'],
'stripslashes' => ['string', 'string'=>'string'],
Expand Down
4 changes: 4 additions & 0 deletions dictionaries/CallMap_74_delta.php
Expand Up @@ -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'],
Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor

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.

Copy link
Contributor Author

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

'new' => ['string', 'string'=>'string', 'allowed_tags='=>'string|null|list<non-empty-string>'],
],
],
'removed' => [
],
Expand Down