[wp-trac] [WordPress Trac] #62454: [ wp-includes/shortcodes.php - do_shortcode() ] - fallback in case content is not a string

WordPress Trac noreply at wordpress.org
Sun Nov 17 10:30:17 UTC 2024


#62454: [ wp-includes/shortcodes.php - do_shortcode() ] - fallback in case content
is not a string
-----------------------------+-----------------------------
 Reporter:  riccardodicurti  |      Owner:  (none)
     Type:  enhancement      |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Shortcodes       |    Version:
 Severity:  trivial          |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 Good morning everyone, while working on a project on php 8, I found that a
 plugin was passing content to do_shortcode() that was not a string and
 this led to an error.

 In my opinion, it would therefore be better to add a check, like
 {{{
 if(! is_string($content) ) { return $content; }
 }}}
 , in order to check what is then passed str_contains().

 Thanks in advance.

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


More information about the wp-trac mailing list