Make WordPress Core

Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#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's profile 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)

rewrite.php.diff (480 bytes) - added by webrocker 18 years ago.
patch for #2771

Download all attachments as: .zip

Change History (6)

#1 @Webrocker
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

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.

#2 @Webrocker
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

@webrocker
18 years ago

patch for #2771

#3 @webrocker
18 years ago

  • Keywords pathinfo|has patch|2nd opinion added; pathinfo possible fix removed

#4 @ryan
18 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [4200]) Don't use rewrite array as string. fixes #2771

#5 @ryan
18 years ago

  • Milestone set to 2.1
Note: See TracTickets for help on using tickets.