Activity Query Code problem

I have this code
<?php if ( bp_has_activities() ) : ?>

<ul id="activity-stream" class="activity-list item-list">

<?php $i = 5; ?>
<?php while ( bp_activities() and $i > 0) : bp_the_activity(); ?>

<li class="<?php bp_activity_css_class(); ?> thebuzz" id="activity-<?php bp_activity_id(); ?>">

">
<?php bp_activity_avatar( 'type=full&width=48&height=48' ); ?>

<div class="activity-content">

<?php $action = bp_get_activity_action();
$pieces = explode(':', $action);
$action = implode('',$pieces); // colon-oscopy
$pieces = explode('·', $action);
$action = implode('',$pieces); // remove ·
echo $action;

echo '
';

if ( bp_get_activity_content_body() )
{
$content = bp_get_activity_content_body();
$pieces = preg_split("/<p>/", $content, 2);
$content = '<p class="content">'.$pieces[1];

$maxwords = 10; // excerpt length
$content_array = explode(' ', $content);
if (count($content_array) > $maxwords)
{
$content = implode(' ',array_slice($content_array, 0, $maxwords)).'[...]</p>';
}
echo $content;

} ?>

<?php //do_action( 'bp_activity_entry_content' ); // not sure what this is for ?>

</div>

<?php $i--;
endwhile; ?>

It does exactly what it should and queries the activity stream. However the urls interpret like this

/domain/http://domain/post/title ect.

How can I clear out that extra domain appendment?