#1841 Trackbacks show wiki formatting


When a trackback is sent it shows the original formatting text of the entry. This is definately not what we want as most sites that offer trackback aren't wikis. Also, since the excerpt is limited to 200 chars any formatting makes the excerpt smaller. I suggest adding parsing of the data and removal of all HTML from the parsed text before doing the substr call for the excerpt. All that needs to be done is to change this line in lib/blogs/bloglib.php:

$submit_vars["excerpt"] = substr($post_info['data'], 0, 200);


$submit_vars["excerpt"] = substr(preg_replace('/<[^>]*>/', '', $this->parse_data($post_info['data'])), 0, 200);


  • Damian Parker

    Damian Parker - 2005-01-17

    Logged In: YES

    Blogs is one of the areas Im interested in, I shall look at
    this and review

  • Damian Parker

    Damian Parker - 2005-01-17
    • assigned_to: nobody --> damosoft
    • status: open --> open-remind
  • Justin Patrin

    Justin Patrin - 2005-01-17

    Logged In: YES

    I also just altered it even more. Now my code gets the last
    space before 200 chars (well, 197) and cuts there to avoid
    breaking up a word. It then adds '...' to the end. I'm not
    sure if the ... is needed, but with the system I was
    trackbacking to it didn't add anythign like that, so...

    New code:

    $submit_vars["excerpt"] = substr(preg_replace('/<[^>]*>/',
    '', $this->parse_data($post_info['data'])), 0, 197);
    $pos = strrpos($submit_vars["excerpt"], ' ');
    if ($pos != 0) {
    $submit_vars["excerpt"] =
    substr($submit_vars["excerpt"], 0, $pos);
    $submit_vars["excerpt"] .= '...';


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks