#12836 closed defect (bug) (fixed)
_deep_replace can cause infinite loop
| Reported by: | mdawaffe | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 3.0 |
| Component: | General | Version: | 3.0 |
| Severity: | major | Keywords: | has-patch commit |
| Cc: | Focuses: |
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
@
17 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Sounds like that's incorrect use as it only wants a string, but that said, seems like a fine defensive check to me.