From f7f411e1f6eb05c512b1a0e3508a266b87a95686 Mon Sep 17 00:00:00 2001 From: Shish Date: Thu, 11 Feb 2010 11:07:57 +0000 Subject: [PATCH] regex for homepage links, hopefully less brokenness than the hand written parser --- contrib/home/main.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/contrib/home/main.php b/contrib/home/main.php index 9338e3ee..43ece3f4 100644 --- a/contrib/home/main.php +++ b/contrib/home/main.php @@ -77,9 +77,8 @@ class Home extends SimpleExtension { // get the homelinks and process them $main_links = $config->get_string('home_links'); $main_links = str_replace('$base', $base_href, $main_links); - $main_links = str_replace('[', "", $main_links); - $main_links = str_replace(']', "", $main_links); + $main_links = preg_replace('#\[(.*?)\|(.*?)\]#', "\\2", $main_links); + $main_links = str_replace('//', "/", $main_links); $main_text = $config->get_string('home_text');