Opened 7 years ago
Closed 7 years ago
#42396 closed defect (bug) (invalid)
question about wp_kses - is that correct?
Reported by: | tazotodua | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | General | Keywords: | |
Focuses: | Cc: |
Description
wp-includes\kses.php, there is:
function wp_kses_split( $string, $allowed_html, $allowed_protocols ) { global $pass_allowed_html, $pass_allowed_protocols; $pass_allowed_html = $allowed_html; $pass_allowed_protocols = $allowed_protocols; return preg_replace_callback( '%(<!--.*?(-->|$))|(<[^>]*(>|$)|>)%', '_wp_kses_split_callback', $string ); }
before the return, there are variables, which are not used anywhere inside that function, is that correct?
Change History (3)
#2
@
7 years ago
- Keywords close added
before the return, there are variables, which are not used anywhere inside that function, is that correct?
No.
global $pass_allowed_html, $pass_allowed_protocols; $pass_allowed_html = $allowed_html; $pass_allowed_protocols = $allowed_protocols;
This means the two global variables are overridden by the function arguments. _wp_kses_split_callback
uses these globals after that.
doesn't that make an infinite loop?
No. wp_kses()
might get called multiple times, that's called recursion. That doesn't automatically make it an infinite loop though.
Note: See
TracTickets for help on using
tickets.
also, my another question, i see some strange cycle:
wp_kses
callswp_kses_split
wp_kses_split
itself, calls_wp_kses_split_callback
_wp_kses_split_callback
callswp_kses_split2
wp_kses_split2
callswp_kses
again...doesnt that make an infinite loop?