[wp-trac] [WordPress Trac] #42396: question about wp_kses - is that correct?

WordPress Trac noreply at wordpress.org
Wed Nov 1 09:47:27 UTC 2017


#42396: question about wp_kses - is that correct?
--------------------------+------------------------------
 Reporter:  tazotodua     |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by tazotodua):

 also, my another question, i see some strange cycle:

 `wp_kses` calls `wp_kses_split`
 {{{
 function wp_kses(
     ....
     return wp_kses_split(.....)
 )
 }}}


 `wp_kses_split` itself, calls `_wp_kses_split_callback`


 {{{
 function wp_kses_split( $string, $allowed_html, $allowed_protocols ) {
         .......
         return preg_replace_callback(...........,
 '_wp_kses_split_callback', .......);
 }
 }}}


 `_wp_kses_split_callback` calls `wp_kses_split2`


 {{{
 function _wp_kses_split_callback( $match ) {
         ........
         return wp_kses_split2(......);
 }

 }}}

  `wp_kses_split2` calls `wp_kses` again...



 {{{
 function wp_kses_split2($string, $allowed_html, $allowed_protocols) {
      .......
        while ( $string != ($newstring = wp_kses(..........)) )
      .....
 }
 }}}

 doesnt that make an infinite loop?

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


More information about the wp-trac mailing list