Make WordPress Core

Opened 2 years ago

Closed 12 months ago

#56482 closed defect (bug) (wontfix)

potential null pointer error

Reported by: kbiegert's profile kbiegert Owned by:
Milestone: Priority: normal
Severity: normal Version: 6.0.2
Component: Script Loader Keywords: has-patch php81
Focuses: Cc:

Description (last modified by SergeyBiryukov)

In wp-includes/script-loader.php near line 2406 within function wp_global_styles_render_svg_filters() the function get_current_screen() can be null causing a null pointer.

Proposal is to add a null check before use:

if (
        is_admin() &&
        get_current_screen() != null &&
        ! get_current_screen()->is_block_editor()
    ) 

Change History (4)

This ticket was mentioned in PR #3163 on WordPress/wordpress-develop by kbiegert.


2 years ago
#1

  • Keywords has-patch added

Prevent null pointer.

Trac ticket: [](https://core.trac.wordpress.org/ticket/56482#ticket)

#2 @SergeyBiryukov
2 years ago

  • Description modified (diff)

#3 @jrf
23 months ago

  • Keywords php81 added

PHP does not have the concept of a null point error.

I presume you mean you are seeing a "passing null to non-nullable" deprecation notice on PHP 8.1 ?

#4 @hellofromTonya
12 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

The wp_global_styles_render_svg_filters() function where this error occurred is deprecated in WP 6.3 via [56101] / #58555.

The issue within the function is not fixed. However, Core no longer calls this function. Since it's deprecated, it should no longer be used.

I'll close this ticket as wontfix. I'm using that resolution type because the function itself will not be changed now that it's deprecated.

Thank you everyone for your contributions!

Note: See TracTickets for help on using tickets.