From 3df3fb3f251c111d5c0107dccfffcb338698eab9 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Thu, 5 Feb 2015 01:23:20 +0000 Subject: [PATCH] added #C and #F shortcuts --- codepot/src/codepot/libraries/wikihelper.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/codepot/src/codepot/libraries/wikihelper.php b/codepot/src/codepot/libraries/wikihelper.php index 5e1ce677..81a8e545 100644 --- a/codepot/src/codepot/libraries/wikihelper.php +++ b/codepot/src/codepot/libraries/wikihelper.php @@ -21,6 +21,20 @@ class WikiHelper $link = "issue/show/{$projectid}/{$num_hex}"; return $link; } + else if (preg_match ('/^#C(\/.*)$/', $name, $matches) == 1) + { + // #C/XXX... -> translate it to a code file + $file_name = $converter->AsciiToHex ($matches[1]); + $link = "code/file/{$projectid}/{$file_name}"; + return $link; + } + else if (preg_match ('/^#F(.+)$/', $name, $matches) == 1) + { + // #Ffilename.tgz -> translate it to a file download + $file_name = $converter->AsciiToHex ($matches[1]); + $link = "file/show/{$projectid}/{$file_name}"; + return $link; + } if ($this->_is_reserved ($name, TRUE)) {