#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: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.1 |
| Component: | Administration | Version: | 2.0.3 |
| Severity: | normal | Keywords: | pingback, permalinks with pathinfo|has patch|2nd opinion |
| Cc: | Focuses: |
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
@
20 years ago
- Keywords pingback permalinks with pathinfo possible fix added
- Summary $rewrite array used as string in url_to_postid function → $rewrite array used as string in url_to_postid() function, breaks incoming pingbacks if permalinks with pathinfo are used
- Version 2.1 → 2.0.3
#2
@
20 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
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.