[wp-trac] [WordPress Trac] #48035: Extra security against warning error for shortcodes

WordPress Trac noreply at wordpress.org
Fri Sep 13 20:49:33 UTC 2019


#48035: Extra security against warning error for shortcodes
---------------------------+------------------------------
 Reporter:  ignatiusjeroe  |       Owner:  (none)
     Type:  enhancement    |      Status:  new
 Priority:  normal         |   Milestone:  Awaiting Review
Component:  Shortcodes     |     Version:  5.2.3
 Severity:  minor          |  Resolution:
 Keywords:  close          |     Focuses:
---------------------------+------------------------------
Changes (by johnbillion):

 * keywords:   => close


Comment:

 Thanks for the report @ignatiusjeroe !

 Replying to [ticket:48035 ignatiusjeroe]:
 > if the users enters a string it triggers an php warning error.

 I think this is expected behaviour. This function expects this parameter
 to be an array and anything else is unexpected.

 PHP warnings exist for a reason, to inform the user that their code isn't
 behaving as expected. Warnings shouldn't be avoided just because they can.
 I think a warning here is appropriate.

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


More information about the wp-trac mailing list