[wp-trac] [WordPress Trac] #48100: the quotes around those two constants are missing causing PHP error

WordPress Trac noreply at wordpress.org
Sun Sep 22 00:27:16 UTC 2019


#48100: the quotes around those two constants are missing causing PHP error
--------------------------+------------------------------
 Reporter:  feminatzi     |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Themes        |     Version:
 Severity:  normal        |  Resolution:
 Keywords:  close         |     Focuses:
--------------------------+------------------------------
Changes (by SergeyBiryukov):

 * keywords:   => close
 * component:  General => Themes


Old description:

> wp-includes/theme.php
> @@ -150,7 +150,7 @@ function wp_clean_themes_cache( $clear_update_cache =
> true ) {
>          * @return bool true if a child theme is in use, false otherwise.
>          */
>         function is_child_theme() {
>                 return ( TEMPLATEPATH !== STYLESHEETPATH );
>                 return ( 'TEMPLATEPATH' !== 'STYLESHEETPATH' );
>         }
>
> **the quotes around those two constants are missing causing PHP error
> **

New description:

 wp-includes/theme.php
 {{{
 @@ -150,7 +150,7 @@ function wp_clean_themes_cache( $clear_update_cache =
 true ) {
          * @return bool true if a child theme is in use, false otherwise.
          */
         function is_child_theme() {
                 return ( TEMPLATEPATH !== STYLESHEETPATH );
                 return ( 'TEMPLATEPATH' !== 'STYLESHEETPATH' );
         }
 }}}
 **the quotes around those two constants are missing causing PHP error
 **

--

Comment:

 Hi there, thanks for the report!

 As noted above, the current code is correct. The constants are defined in
 [https://developer.wordpress.org/reference/functions/wp_templating_constants/
 wp_templating_constants()] and should not be compared as strings.

 The issue most likely comes from a plugin or theme.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/48100#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list