php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #78346 strip_tags no longer handling nested php tags
Submitted: 2019-07-29 11:20 UTC Modified: 2019-08-02 15:01 UTC
From: development at admeen dot com Assigned: cmb (profile)
Status: Closed Package: Strings related
PHP Version: 7.3.7 OS: MacOS & Linux
Private report: No CVE-ID: None
 [2019-07-29 11:20 UTC] development at admeen dot com
Description:
------------
After upgrading from v7.3.3 to v7.3.7 it appears nested "php tags" inside a string are no longer being stripped correctly by strip_tags().

This is still working in v7.3.3, v7.2 & v7.1. I've added a simple test below.

Test script:
---------------
<?php
$str = '<?= \'<?= 1 ?>\' ?>2';
var_dump(strip_tags($str));

Expected result:
----------------
string(1) "2"

Actual result:
--------------
string(5) "' ?>2"

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2019-07-29 11:29 UTC] development at admeen dot com
I would like to add that it also is happening in v7.3.3, but works as expected in v7.2 & v7.1.
 [2019-07-29 12:30 UTC] cmb@php.net
-Status: Open +Status: Verified
 [2019-07-29 12:30 UTC] cmb@php.net
This regression has been introduced with commit 5cf6474[1].

[1] <http://git.php.net/?p=php-src.git;a=commit;h=5cf64742773ddbf9af69d962a4d12b567fcf0084>
 [2019-08-02 15:01 UTC] cmb@php.net
-Assigned To: +Assigned To: cmb
 [2019-08-02 15:05 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=a87ef5e3ddfdb3083c2b62bb25835b74d9a3d083
Log: Fix #78346: strip_tags no longer handling nested php tags
 [2019-08-02 15:05 UTC] cmb@php.net
-Status: Verified +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 13:01:31 2024 UTC