Make WordPress Core

Changes between Initial Version and Version 15 of Ticket #57579


Ignore:
Timestamp:
08/08/2023 07:01:53 PM (16 months ago)
Author:
hellofromTonya
Comment:

This ticket's scope has grown past the original reported issue. Thus, I've updated the Summary and Description to help contributors know what is being proposed and the work yet to be done.

I've also added the php-compatibility focus to include strip_tags() usage in Core in the PHP 8.1 compat exclusion list.

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #57579

    • Property Focuses php-compatibility added
    • Property Component changed from Plugins to General
    • Property Summary changed from Deprecated: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in admin-header.php to Replace most strip_tags() with wp_strip_tags()
    • Property Milestone changed from Awaiting Review to Future Release
    • Property Keywords php81 has-patch changes-requested needs-unit-tests added; PHP81 removed
  • Ticket #57579 – Description

    initial v15  
     1Originally reported as an issue with `strip_tags()` in `wp-admin/admin-header.php`, this ticket's scope as grown to initiative to replace `strip_tags()` with `wp_strip_tags()`.
     2
     3Proposal:
     4
     5* Replace most calls to `strip_tags()` with calls to `wp_strip_all_tags()`
     6@peterwilsoncc [#comment:1 notes]:
     7>this is a slight compatibility change as it will strip the contents of `<style>` and `<script>` tags, but I don't think that's a bad thing
     8
     9* Add an early check in `wp-admin/admin-header.php` to set up the global variables.
     10
     11@jrf [#comment:2 notes]:
     12>I can see one more alternative option, which could (should) possible be applied in conjunction with the solution suggested by @peterwilsoncc: for `wp-admin/admin-header.php` to do an early check for the global variables it requires to be set and to set those to a default value (for example, an empty string for `$title`) if the variable is not available.
     13
     14The original reported issue:
     15
    116When using the plugin HD Quiz this warning is given in version 6.2-alpha-55159 with PHP 8.1.
    217
     18{{{
    319Deprecated: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in /public_html/blog/wp-admin/admin-header.php on line 36
     20}}}
    421
    522Link to ticket for plugin: