From ad2adac63f90eb98fcf12bc02274474ef548d5e1 Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Fri, 26 Jun 2020 01:33:34 +0000 Subject: [PATCH] enhanced wikihelper.php to support the versioned code link in wikiformatting --- codepot/src/codepot/libraries/wikihelper.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/codepot/src/codepot/libraries/wikihelper.php b/codepot/src/codepot/libraries/wikihelper.php index 703f60bd..9415a8be 100644 --- a/codepot/src/codepot/libraries/wikihelper.php +++ b/codepot/src/codepot/libraries/wikihelper.php @@ -29,11 +29,13 @@ class WikiHelper $link = "issue/show/{$projectid}/{$num_hex}"; return $link; } - else if (preg_match ('/^#C(\/.*)$/', $name, $matches) == 1) + else if (preg_match ('/^#C([[:digit:]]*)(\/.*)$/', $name, $matches) == 1) { // #C/XXX... -> translate it to a code file - $file_name = $converter->AsciiToHex ($matches[1]); + // #C123/XXX... -> translate it to a code file at revision 123 + $file_name = $converter->AsciiToHex ($matches[2]); $link = "code/file/{$projectid}/{$file_name}"; + if (strlen($matches[1]) > 0) $link .= "/" . $matches[1]; return $link; } else if (preg_match ('/^#F(.+)$/', $name, $matches) == 1)