[wp-trac] [WordPress Trac] #23915: discover_pingback_server_uri cases an error when discovery URI sets multiple Content-type headers

WordPress Trac noreply at wordpress.org
Mon Apr 1 14:25:37 UTC 2013


#23915: discover_pingback_server_uri cases an error when discovery URI sets
multiple Content-type headers
-----------------------------+------------------------------
 Reporter:  tomdxw           |       Type:  defect (bug)
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  Pings/Trackbacks
  Version:  3.5.1            |   Severity:  normal
 Keywords:                   |
-----------------------------+------------------------------
 Line 1673 in wp-includes/comment.php uses preg_match() on the output of
 wp_remote_retrieve_header(). When multiple headers are set of the same
 name, wp_remote_retrieve_header() returns an array.

 Thus occasionally the following error occurs:

 PHP Warning: preg_match() expects parameter 2 to be string, array given in
 xxxxxxx/wp-includes/comment.php on line 1673

 I have no idea how to make pingbacks happen so to reproduce, add this line
 to functions.php: discover_pingback_server_uri('http://localhost:8080/');

 And in a terminal window run this (you may need to install the netcat-
 openbsd package in Debuntu): while true; do echo -en 'HTTP/1.1 200 OK\r
 \nContent-type: text/html\r\nContent-type: text/plain\r\n\r\n' | nc -lp
 8080; done

 Then visit your WP installation and you shall get the aforementioned error
 message.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23915>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list