From 0bf95f21c3cfc411b16e3ca372198aa4da12bcf3 Mon Sep 17 00:00:00 2001 From: Andrew O'Neil Date: Fri, 12 Feb 2010 23:47:43 +0000 Subject: [PATCH] BUGFIX: Sometimes link doesnt work correctly --- code/BlogEntry.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/BlogEntry.php b/code/BlogEntry.php index c02e0f0..6f5c0d1 100644 --- a/code/BlogEntry.php +++ b/code/BlogEntry.php @@ -100,10 +100,12 @@ class BlogEntry extends Page { $tags = split(" *, *", trim($this->Tags)); $output = new DataObjectSet(); + $link = $this->getParent() ? $this->getParent()->Link('tag') : ''; + foreach($tags as $tag) { $output->push(new ArrayData(array( 'Tag' => $tag, - 'Link' => $this->getParent()->Link('tag') . '/' . urlencode($tag), + 'Link' => $link . '/' . urlencode($tag), 'URLTag' => urlencode($tag) ))); }