#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: | bernardos | Owned by: | |
---|---|---|---|
Milestone: | 2.1 | Priority: | normal |
Severity: | normal | Version: | 2.0.3 |
Component: | Administration | Keywords: | pingback, permalinks with pathinfo|has patch|2nd opinion |
Focuses: | 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)
#1
@
18 years ago
- 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
#2
@
18 years ago
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
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.