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 8299157..d2b54e7 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('/(\[\[)(.*?)\|(.*?)(\]\])/', 'linkToInternalPageWithText' ,$string); + $string = preg_replace_callback('/(\[\[)(.*?)(\]\])/', 'linkToInternalPage' ,$string); $string = preg_replace_callback('/(\[a\])(.*?)(\[\/a\])/', 'linkTo',$string); @@ -276,6 +278,11 @@ function linkToInternalPage($match) return "<a title = '".$match[2]."' href='http://".DOMAIN_NAME."/wiki/page/".Lang::$current."/".encodeUrl($match[2])."'>".$match[2]."</a>"; } +function linkToInternalPageWithText($match) +{ + return "<a title = '".$match[2]."' href='http://".DOMAIN_NAME."/wiki/page/".Lang::$current."/".encodeUrl($match[2])."'>".$match[3]."</a>"; +} + function linkToWithText($match) { if (checkUrl($match[2])) |