Skip to content

Commit 94bd5f6

Browse files
authored
Merge pull request #8 from durenadev/MDLSITE-8101
MDLSITE-8101: Update tracker links
2 parents b4cdea0 + 0b12751 commit 94bd5f6

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

classes/text_filter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class text_filter extends \core_filters\text_filter {
4242
'moodle themes' => array('<a title="Auto-link" href="https://moodle.org/themes">', false, true, 'Moodle Themes'),
4343
'moodle partners' => array('<a title="Auto-link" href="https://moodle.com/partners">', false, true, 'Moodle Partners'),
4444
'moodle partner' => array('<a title="Auto-link" href="https://moodle.com/partners">', false, true, 'Moodle Partner'),
45-
'moodle tracker' => array('<a title="Auto-link" href="https://tracker.moodle.org">', false, true, 'Moodle Tracker'),
45+
'moodle tracker' => array('<a title="Auto-link" href="https://moodle.atlassian.net">', false, true, 'Moodle Tracker'),
4646
'moodle jobs' => array('<a title="Auto-link" href="https://moodle.org/jobs">', false, true, 'Moodle jobs'),
4747
'moodle books' => array('<a title="Auto-link" href="https://moodle.org/books">', false, true, 'Moodle books'),
4848
'mooch' => array('<a title="MoodleNet - Connecting and empowering educators worldwide" href="https://moodle.net">', false, true),
@@ -98,7 +98,7 @@ public function filter($text, array $options = array()) {
9898
'(?![^<]*</a>)' . // Try to avoid matching inside another link. Can be fooled by HTML like: <a href="..."><b>MDL-123</b></a>.
9999
'#';
100100
$text = preg_replace($regexp,
101-
'<a title="Auto-link to Moodle Tracker" href="https://tracker.moodle.org/browse/$0">$0</a>',
101+
'<a title="Auto-link to Moodle Tracker" href="https://moodle.atlassian.net/browse/$0">$0</a>',
102102
$text);
103103

104104
return $text;

tests/text_filter_test.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function test_filter_simple() {
5555
'A MOODLE themes.' => 'A <a title="Auto-link" href="https://moodle.org/themes">Moodle Themes</a>.',
5656
'A MOODLE partners,' => 'A <a title="Auto-link" href="https://moodle.com/partners">Moodle Partners</a>,',
5757
'A MOODLE partner:' => 'A <a title="Auto-link" href="https://moodle.com/partners">Moodle Partner</a>:',
58-
'A MOODLE trackeR:' => 'A <a title="Auto-link" href="https://tracker.moodle.org">Moodle Tracker</a>:',
58+
'A MOODLE trackeR:' => 'A <a title="Auto-link" href="https://moodle.atlassian.net">Moodle Tracker</a>:',
5959
'A MOODLE jobs/' => 'A <a title="Auto-link" href="https://moodle.org/jobs">Moodle jobs</a>/',
6060
'.MOODLE books' => '.<a title="Auto-link" href="https://moodle.org/books">Moodle books</a>',
6161
',MoocH' => ',<a title="MoodleNet - Connecting and empowering educators worldwide" href="https://moodle.net">MoocH</a>',
@@ -98,17 +98,17 @@ function test_filter_tracker() {
9898
'<a href="https://example.com/a/very/very/long/url/containing/MDL-123"><br />MDL-123</a>' => '<a href="https://example.com/a/very/very/long/url/containing/MDL-123"><br />MDL-123</a>',
9999

100100
// A known limit of the regexp, we have to live with it (unless somebody fixes it without breaking the rest)
101-
'search Google for <a href="https://www.google.com.au/"><b>MDLSITE-0</b></a>' => 'search Google for <a href="https://www.google.com.au/"><b><a title="Auto-link to Moodle Tracker" href="https://tracker.moodle.org/browse/MDLSITE-0">MDLSITE-0</a></b></a>',
101+
'search Google for <a href="https://www.google.com.au/"><b>MDLSITE-0</b></a>' => 'search Google for <a href="https://www.google.com.au/"><b><a title="Auto-link to Moodle Tracker" href="https://moodle.atlassian.net/browse/MDLSITE-0">MDLSITE-0</a></b></a>',
102102

103103
// Replaced cases by Tim's regexp
104-
'MDL-123' => '<a title="Auto-link to Moodle Tracker" href="https://tracker.moodle.org/browse/MDL-123">MDL-123</a>',
105-
'<b>MDL-123</b>' => '<b><a title="Auto-link to Moodle Tracker" href="https://tracker.moodle.org/browse/MDL-123">MDL-123</a></b>',
106-
'See MDL-1 for details!' => 'See <a title="Auto-link to Moodle Tracker" href="https://tracker.moodle.org/browse/MDL-1">MDL-1</a> for details!',
107-
'https://www.google.com.au/search?q=MDL-1' => 'https://www.google.com.au/search?q=<a title="Auto-link to Moodle Tracker" href="https://tracker.moodle.org/browse/MDL-1">MDL-1</a>',
108-
'<a href="https://example.com">Link</a>https://www.google.com.au/search?q=MDL-123' => '<a href="https://example.com">Link</a>https://www.google.com.au/search?q=<a title="Auto-link to Moodle Tracker" href="https://tracker.moodle.org/browse/MDL-123">MDL-123</a>',
109-
'search for MDL-123 on <a href="https://www.google.com.au/">Google</a>' => 'search for <a title="Auto-link to Moodle Tracker" href="https://tracker.moodle.org/browse/MDL-123">MDL-123</a> on <a href="https://www.google.com.au/">Google</a>',
110-
'<br /> This should be working - MDL-123. Please vote for it if you\'d like... <br />' => '<br /> This should be working - <a title="Auto-link to Moodle Tracker" href="https://tracker.moodle.org/browse/MDL-123">MDL-123</a>. Please vote for it if you\'d like... <br />',
111-
"The bug 'MDL-123' is > (more serious than)" => "The bug '<a title=\"Auto-link to Moodle Tracker\" href=\"https://tracker.moodle.org/browse/MDL-123\">MDL-123</a>' is > (more serious than)",
104+
'MDL-123' => '<a title="Auto-link to Moodle Tracker" href="https://moodle.atlassian.net/browse/MDL-123">MDL-123</a>',
105+
'<b>MDL-123</b>' => '<b><a title="Auto-link to Moodle Tracker" href="https://moodle.atlassian.net/browse/MDL-123">MDL-123</a></b>',
106+
'See MDL-1 for details!' => 'See <a title="Auto-link to Moodle Tracker" href="https://moodle.atlassian.net/browse/MDL-1">MDL-1</a> for details!',
107+
'https://www.google.com.au/search?q=MDL-1' => 'https://www.google.com.au/search?q=<a title="Auto-link to Moodle Tracker" href="https://moodle.atlassian.net/browse/MDL-1">MDL-1</a>',
108+
'<a href="https://example.com">Link</a>https://www.google.com.au/search?q=MDL-123' => '<a href="https://example.com">Link</a>https://www.google.com.au/search?q=<a title="Auto-link to Moodle Tracker" href="https://moodle.atlassian.net/browse/MDL-123">MDL-123</a>',
109+
'search for MDL-123 on <a href="https://www.google.com.au/">Google</a>' => 'search for <a title="Auto-link to Moodle Tracker" href="https://moodle.atlassian.net/browse/MDL-123">MDL-123</a> on <a href="https://www.google.com.au/">Google</a>',
110+
'<br /> This should be working - MDL-123. Please vote for it if you\'d like... <br />' => '<br /> This should be working - <a title="Auto-link to Moodle Tracker" href="https://moodle.atlassian.net/browse/MDL-123">MDL-123</a>. Please vote for it if you\'d like... <br />',
111+
"The bug 'MDL-123' is > (more serious than)" => "The bug '<a title=\"Auto-link to Moodle Tracker\" href=\"https://moodle.atlassian.net/browse/MDL-123\">MDL-123</a>' is > (more serious than)",
112112

113113
// The texts like 'bug #123' or 'bug 123' should not be processed (MDLSITE-4019).
114114
'Bug 123X' => 'Bug 123X',
@@ -121,11 +121,11 @@ function test_filter_tracker() {
121121
'https://www.google.com.au/search?q=Bug 123' => 'https://www.google.com.au/search?q=Bug 123',
122122

123123
// Links to other projects (CONTRIB, MDLSITE, MDLQA, MDLTEST, MOBILE)
124-
'CONTRIB-1234567890' => '<a title="Auto-link to Moodle Tracker" href="https://tracker.moodle.org/browse/CONTRIB-1234567890">CONTRIB-1234567890</a>',
125-
'MDLSITE-0' => '<a title="Auto-link to Moodle Tracker" href="https://tracker.moodle.org/browse/MDLSITE-0">MDLSITE-0</a>',
126-
'MDLQA-0' => '<a title="Auto-link to Moodle Tracker" href="https://tracker.moodle.org/browse/MDLQA-0">MDLQA-0</a>',
127-
'MDLTEST-0' => '<a title="Auto-link to Moodle Tracker" href="https://tracker.moodle.org/browse/MDLTEST-0">MDLTEST-0</a>',
128-
'MOBILE-1234567890' => '<a title="Auto-link to Moodle Tracker" href="https://tracker.moodle.org/browse/MOBILE-1234567890">MOBILE-1234567890</a>',
124+
'CONTRIB-1234567890' => '<a title="Auto-link to Moodle Tracker" href="https://moodle.atlassian.net/browse/CONTRIB-1234567890">CONTRIB-1234567890</a>',
125+
'MDLSITE-0' => '<a title="Auto-link to Moodle Tracker" href="https://moodle.atlassian.net/browse/MDLSITE-0">MDLSITE-0</a>',
126+
'MDLQA-0' => '<a title="Auto-link to Moodle Tracker" href="https://moodle.atlassian.net/browse/MDLQA-0">MDLQA-0</a>',
127+
'MDLTEST-0' => '<a title="Auto-link to Moodle Tracker" href="https://moodle.atlassian.net/browse/MDLTEST-0">MDLTEST-0</a>',
128+
'MOBILE-1234567890' => '<a title="Auto-link to Moodle Tracker" href="https://moodle.atlassian.net/browse/MOBILE-1234567890">MOBILE-1234567890</a>',
129129
);
130130

131131
$filter = new testable_filter_moodlelinks();

0 commit comments

Comments
 (0)