Skip to content

PHP 5.3.4: new ForbiddenStripTagsSelfClosingXHTML sniff#866

Merged
wimg merged 1 commit intomasterfrom
php-5.3.4/new-forbidden-striptags-selfclosingxhtml-sniff
Aug 28, 2019
Merged

PHP 5.3.4: new ForbiddenStripTagsSelfClosingXHTML sniff#866
wimg merged 1 commit intomasterfrom
php-5.3.4/new-forbidden-striptags-selfclosingxhtml-sniff

Conversation

@jrfnl
Copy link
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants