PHP 5.3.4: new ForbiddenStripTagsSelfClosingXHTML sniff by jrfnl · Pull Request #866 · PHPCompatibility/PHPCompatibility

Skip to content

Navigation Menu

Sign in

Appearance settings

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

@jrfnl

Copy link Copy Markdown

Member

@jrfnl jrfnl commented

Aug 20, 2019

In PHP 5.3.4 and later, self-closing XHTML tags are ignored and only non-self-closing tags should be used in allowable_tags. For example, to allow both <br> and <br/>, you should use:

<?php
strip_tags($input, '<br>');
?>

Ref:

@jrfnl jrfnl added this to the 9.3.0 milestone

Aug 20, 2019

@jrfnl jrfnl requested a review from wimg

August 20, 2019 02:58

@jrfnl jrfnl force-pushed the php-5.3.4/new-forbidden-striptags-selfclosingxhtml-sniff branch 2 times, most recently from 32fd1bc to 9936124 Compare

August 20, 2019 04:57
> In PHP 5.3.4 and later, self-closing XHTML tags are ignored and only non-self-closing tags should be used in allowable_tags. For example, to allow both <br> and <br/>, you should use:
> ```php
> <?php
> strip_tags($input, '<br>');
> ?>
> ```

Ref:
* https://www.php.net/manual/en/function.strip-tags.php#refsect1-function.strip-tags-changelog

@jrfnl jrfnl force-pushed the php-5.3.4/new-forbidden-striptags-selfclosingxhtml-sniff branch from 9936124 to fd36285 Compare

August 21, 2019 09:40

@wimg wimg merged commit 0c3be21 into master

Aug 28, 2019

@delete-merged-branch delete-merged-branch bot deleted the php-5.3.4/new-forbidden-striptags-selfclosingxhtml-sniff branch

August 28, 2019 14:47

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@wimg wimg wimg approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

9.3.0

Development

Successfully merging this pull request may close these issues.

2 participants

@jrfnl @wimg