[wp-trac] [WordPress Trac] #35023: get_field_name() returns a bad field name if you pass it "display][avatar_size"

WordPress Trac noreply at wordpress.org
Sun Dec 27 19:55:56 UTC 2015


#35023: get_field_name() returns a bad field name if you pass it
"display][avatar_size"
-------------------------------------------------+-------------------------
 Reporter:  pbearne                              |       Owner:
     Type:  defect (bug)                         |  johnbillion
 Priority:  normal                               |      Status:  assigned
Component:  Widgets                              |   Milestone:  4.4.1
 Severity:  normal                               |     Version:  4.4
 Keywords:  has-patch has-unit-tests 2nd-        |  Resolution:
  opinion                                        |     Focuses:
                                                 |  administration
-------------------------------------------------+-------------------------

Comment (by pbearne):

 One of the reasons I have been pushing this is the feel that the test
 currently used is  not the best why to test to see if an "array string" is
 passed

 I currently just looks for a "[" somewhere in the string (it can be the
 last letter). I have changed this to look for closing "]" which I feel is
 safer as the code assumes that there is one

 My Plugin may be the only one to break and all I can do is fix the string
 that is returned.

 Luckily I had wrapped the call in a local function and I can do a replace
 on the "[[" with a single "[" and add the missing "]" so I am fixed.

 But I would still encourage you to change the if statement to the look for
 the trailing "]" as this a safer test

 Paul

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


More information about the wp-trac mailing list