Commit MetaInfo

修订版5591242f41c439265fc50302d9f6f21b36c938e0 (tree)
时间2019-01-26 00:45:53
作者umorigu <umorigu@gmai...>
Commiterumorigu

Log Message

BugTrack/2484 AutoTicketLink for JIRA: Support underscore key XX_X

更改概述

差异

--- a/lib/make_link.php
+++ b/lib/make_link.php
@@ -949,7 +949,7 @@ function get_ticketlink_jira_projects()
949949 $m = null;
950950 if (preg_match('/^-\s*(jira)\s+(https?:\/\/[!~*\'();\/?:\@&=+\$,%#\w.-]+)\s*$/', $line, $m)) {
951951 $active_jira_base_url = $m[2];
952- } else if (preg_match('/^--\s*([A-Z][A-Z0-9]+)(\s+(.+?))?\s*$/', $line, $m)) {
952+ } else if (preg_match('/^--\s*([A-Z][A-Z0-9]{1,10}(?:_[A-Z0-9]{1,10}){0,2})(\s+(.+?))?\s*$/', $line, $m)) {
953953 if ($active_jira_base_url) {
954954 $project_key = $m[1];
955955 $title = $m[2];
--- a/skin/main.js
+++ b/skin/main.js
@@ -124,7 +124,8 @@ window.addEventListener && window.addEventListener('DOMContentLoaded', function(
124124 var reText = '';
125125 switch (site.type) {
126126 case 'jira':
127- reText = '(' + regexEscape(site.key) + '):([A-Z][A-Z0-9]{1,20}-\\d{1,10})';
127+ reText = '(' + regexEscape(site.key) +
128+ '):([A-Z][A-Z0-9]{1,20}(?:_[A-Z0-9]{1,10}){0,2}-\\d{1,10})';
128129 break;
129130 case 'redmine':
130131 reText = '(' + regexEscape(site.key) + '):(\\d{1,10})';
@@ -140,7 +141,7 @@ window.addEventListener && window.addEventListener('DOMContentLoaded', function(
140141 }
141142 }
142143 function getJiraSite() {
143- var reText = '()([A-Z][A-Z0-9]{1,20}-\\d{1,10})';
144+ var reText = '()([A-Z][A-Z0-9]{1,20}(?:_[A-Z0-9]{1,10}){0,2}-\\d{1,10})';
144145 var site = {
145146 title: 'Builtin JIRA',
146147 type: '_jira_',
Show on old repository browser