Make WordPress Core

Opened 20 years ago

Closed 20 years ago

#605 closed defect (bug) (fixed)

wp-trackback.php breaks API 'trackback_post' action functionality

Reported by: jminard's profile jminard Owned by: michel-v's profile michel v
Milestone: Priority: normal
Severity: major Version: 1.2
Component: General Keywords:
Focuses: Cc:

Description

In the file wp-trackback.php at line 88 and 89 it reads:

trackback_response(0);
do_action('trackback_post', $comment_ID);

but the function trackback_response() calls a die() in it, thus the trackback_post actions are never applied.

Solution: Flip the two lines. All better.

Change History (5)

#1 @jminard
20 years ago

  • Patch set to No

#2 @michel v
20 years ago

  • Owner changed from anonymous to michel v
  • Resolution changed from 10 to 70
  • Status changed from new to closed

The die() command only ever gets executed when trackback_response() is called with a first parameter that is not 0.
So if functions in the trackback_post hook does not get executed, then it is either a problem with one of the functions, or a problem with WP's API. But either way, it's not a problem with the order of these lines.

#3 @jminard
20 years ago

  • Resolution changed from 70 to 30
  • Status changed from closed to assigned

from wp-includes/functions.php:

trackback - reply
function trackback_response($error = 0, $error_message = ) {

if ($error) {

echo '<?xml version="1.0" encoding="iso-8859-1"?'.">\n";
echo "<response>\n";
echo "<error>1</error>\n";
echo "<message>$error_message</message>\n";
echo "</response>";

} else {

echo '<?xml version="1.0" encoding="iso-8859-1"?'.">\n";
echo "<response>\n";
echo "<error>0</error>\n";
echo "</response>";

}
die();

}

I can pretty clearly see that this function calls "die()" no matter what you pass it.

Thus, it calls die() and do_action() never happens.

I just checked the download from 1.2.2 and both sections of code have not changed, so this is still an issue.

#4 @MC_incubus
20 years ago

Another solution could be to move the die() into the if($error) { } position.

#5 @matt
20 years ago

  • fixed_in_version set to 1.5
  • Resolution changed from 30 to 20
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.