#12836 closed defect (bug) (fixed)
_deep_replace can cause infinite loop
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | 3.0 | Priority: | low |
| Severity: | major | Version: | 3.0 |
| Component: | General | Keywords: | has-patch commit |
| Focuses: | Cc: |
Description
Calling _deep_replace( $search, $subject ) on an array $subject can cause an infinite loop since strpos( array(), 'foo' ) will return NULL.
Patch attached.
Attachments (1)
Change History (4)
#3
in reply to:
↑ 1
@
16 years ago
Replying to nacin:
Sounds like that's incorrect use as it only wants a string, but that said, seems like a fine defensive check to me.
It is an incorrect use. I came across the problem when I accidentally did esc_url( get_post_meta( ... ) ) (since get_post_meta returns an array by default).
Note: See
TracTickets for help on using
tickets.
Sounds like that's incorrect use as it only wants a string, but that said, seems like a fine defensive check to me.