[wp-trac] [WordPress Trac] #57579: Deprecated: strip_tags(): Passing null to parameter #1 ($string) of type string is deprecated in admin-header.php
WordPress Trac
noreply at wordpress.org
Mon Jan 30 17:46:17 UTC 2023
#57579: Deprecated: strip_tags(): Passing null to parameter #1 ($string) of type
string is deprecated in admin-header.php
--------------------------+---------------------
Reporter: ipajen | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: 6.2
Component: General | Version:
Severity: normal | Resolution:
Keywords: PHP81 | Focuses:
--------------------------+---------------------
Comment (by SergeyBiryukov):
Replying to [comment:2 jrf]:
> 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.
Indeed, that sounds like a good idea too. We already this for
`$current_screen`:
{{{
// Catch plugins that include admin-header.php before admin.php completes.
if ( empty( $current_screen ) ) {
set_current_screen();
}
}}}
Might be worth doing the same for other variables, though I think I would
do this on a case-by-case basis for those that are known to cause notices
if not set, like `$title` here.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/57579#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list