#2771 closed defect (bug) (fixed)
$rewrite array used as string in url_to_postid() function, breaks incoming pingbacks if permalinks with pathinfo are used
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | 2.1 |
| Component: | Administration | Version: | 2.0.3 |
| Severity: | normal | Keywords: | pingback, permalinks with pathinfo|has patch|2nd opinion |
| Cc: |
Description
In line 100 in wp-includes/rewrite.php
if ( false === strpos($rewrite, 'index.php/') )
but $rewrite is an array
Attachments (1)
Change History (6)
- Keywords pingback permalinks with pathinfo possible fix added
- Summary changed from $rewrite array used as string in url_to_postid function to $rewrite array used as string in url_to_postid() function, breaks incoming pingbacks if permalinks with pathinfo are used
- Version changed from 2.1 to 2.0.3
in 2.0.3 the url_to_postid() function is declared in wp-includes/functions.php (around line 217), not in wp-includes/rewrite.php
- Keywords pathinfo|has patch|2nd opinion added; pathinfo possible fix removed
- Resolution set to fixed
- Status changed from new to closed
Note: See
TracTickets for help on using
tickets.

This will break Pingbacks if Permalinks with PATHINFO are used, because the 'index.php/' part will always be removed from $url and thus no valid postid will be returned.
Possible fix:
if ( false === strpos( key($rewrite),'index.php/') )
Assuming that the rewrite-rules all include 'index.php/' if Permalinks with PATHINFO are used, it should be safe to only check the first key of the $rewrite array.