diff options
Diffstat (limited to 'h-source/Application/Include/myFunctions.php')
-rw-r--r-- | h-source/Application/Include/myFunctions.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/h-source/Application/Include/myFunctions.php b/h-source/Application/Include/myFunctions.php index d494eb6..8299157 100644 --- a/h-source/Application/Include/myFunctions.php +++ b/h-source/Application/Include/myFunctions.php @@ -195,6 +195,8 @@ function decodeWikiText($string) $string = preg_replace('/(\[hr\])/', '<hr />',$string); + $string = preg_replace_callback('/(\[\[)(.*?)(\]\])/', 'linkToInternalPage' ,$string); + $string = preg_replace_callback('/(\[a\])(.*?)(\[\/a\])/', 'linkTo',$string); $string = preg_replace_callback('/(\[a\])(.*?)\|(.*?)(\[\/a\])/', 'linkToWithText',$string); @@ -269,6 +271,11 @@ function linkTo($match) } } +function linkToInternalPage($match) +{ + return "<a title = '".$match[2]."' href='http://".DOMAIN_NAME."/wiki/page/".Lang::$current."/".encodeUrl($match[2])."'>".$match[2]."</a>"; +} + function linkToWithText($match) { if (checkUrl($match[2])) |