[wp-trac] [WordPress Trac] #57512: Warning as a part of API response

WordPress Trac noreply at wordpress.org
Sat Feb 4 00:48:52 UTC 2023


#57512: Warning as a part of API response
-------------------------------------------------+-------------------------
 Reporter:  kalpeshh                             |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Awaiting
                                                 |  Review
Component:  REST API                             |     Version:  6.1.1
 Severity:  normal                               |  Resolution:
 Keywords:  2nd-opinion php8 has-unit-tests      |     Focuses:  rest-api
  has-patch                                      |
-------------------------------------------------+-------------------------

Comment (by jrf):

 @shooper Thanks for making those updates to the patch.

 I do wonder whether this is correct ?
 {{{#!php
 <?php
 if ( 2 !== count($exploded_basic_auth) ) {
     return;
 }
 }}}

 Why not use [https://www.php.net/manual/en/function.explode.php
 `explode()`] with the `$limit` parameter set to `2` ?

 I also think it would be good to have a closer look at some of URL/URI
 RFCs to see what those say about the user and password field encoding and
 possible get some more test cases based on those RFCs.

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


More information about the wp-trac mailing list