regex for homepage links, hopefully less brokenness than the hand written parser
This commit is contained in:
parent
9b98e6c90a
commit
f7f411e1f6
1 changed files with 2 additions and 3 deletions
|
@ -77,9 +77,8 @@ class Home extends SimpleExtension {
|
||||||
// get the homelinks and process them
|
// get the homelinks and process them
|
||||||
$main_links = $config->get_string('home_links');
|
$main_links = $config->get_string('home_links');
|
||||||
$main_links = str_replace('$base', $base_href, $main_links);
|
$main_links = str_replace('$base', $base_href, $main_links);
|
||||||
$main_links = str_replace('[', "<a href='", $main_links);
|
$main_links = preg_replace('#\[(.*?)\|(.*?)\]#', "<a href='\\1'>\\2</a>", $main_links);
|
||||||
$main_links = str_replace('|', "'>", $main_links);
|
$main_links = str_replace('//', "/", $main_links);
|
||||||
$main_links = str_replace(']', "</a>", $main_links);
|
|
||||||
|
|
||||||
$main_text = $config->get_string('home_text');
|
$main_text = $config->get_string('home_text');
|
||||||
|
|
||||||
|
|
Reference in a new issue