[wp-trac] [WordPress Trac] #63572: theme.json file variable could be a directory, add check to prevent notices

WordPress Trac noreply at wordpress.org
Mon Jun 16 08:34:14 UTC 2025


#63572: theme.json file variable could be a directory, add check to prevent notices
---------------------------+-----------------------------
 Reporter:  ramon fincken  |      Owner:  (none)
     Type:  defect (bug)   |     Status:  new
 Priority:  normal         |  Milestone:  Awaiting Review
Component:  Themes         |    Version:  trunk
 Severity:  normal         |   Keywords:  has-patch
  Focuses:                 |
---------------------------+-----------------------------
 In class-wp-theme-json-resolver.php

 https://github.com/WordPress/wordpress-develop/blob/6.8.1/src/wp-includes
 /class-wp-theme-json-resolver.php#L254

 is the line
 {{{#!php
 if ( is_readable( $theme_json_file ) ) {
 }}}

 However if the $theme_json_file is a directory that will return true, even
 if it expects a .json local file path.

 In this patch I propose adding is_file ( and perhaps even removing
 is_readable, as is_readable will also return true for directories ).

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/63572>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list