mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-23 14:00:56 +01:00
Unlink Q1 - Q4
Summary: Q1 to Q4 is used for parts of the year. Also unlink all `[A-Z]0.*`, we don't route them anymore. Test Plan: Q0 Q1 Q10 Reviewers: epriestley, pieter Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D3781
This commit is contained in:
parent
c24f4411c1
commit
89b9d56cbe
2 changed files with 6 additions and 7 deletions
|
@ -27,18 +27,17 @@ abstract class PhabricatorRemarkupRuleObjectName
|
||||||
public function apply($text) {
|
public function apply($text) {
|
||||||
$prefix = $this->getObjectNamePrefix();
|
$prefix = $this->getObjectNamePrefix();
|
||||||
return preg_replace_callback(
|
return preg_replace_callback(
|
||||||
"@\b{$prefix}(\d+)(?:#([-\w\d]+))?\b@",
|
"@\b({$prefix})([1-9]\d*)(?:#([-\w\d]+))?\b@",
|
||||||
array($this, 'markupObjectNameLink'),
|
array($this, 'markupObjectNameLink'),
|
||||||
$text);
|
$text);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function markupObjectNameLink($matches) {
|
public function markupObjectNameLink($matches) {
|
||||||
$prefix = $this->getObjectNamePrefix();
|
list(, $prefix, $id) = $matches;
|
||||||
$id = $matches[1];
|
|
||||||
|
|
||||||
if (isset($matches[2])) {
|
if (isset($matches[3])) {
|
||||||
$href = $matches[2];
|
$href = $matches[3];
|
||||||
$text = $matches[2];
|
$text = $matches[3];
|
||||||
if (preg_match('@^(?:comment-)?(\d{1,7})$@', $href, $matches)) {
|
if (preg_match('@^(?:comment-)?(\d{1,7})$@', $href, $matches)) {
|
||||||
// Maximum length is 7 because 12345678 could be a file hash.
|
// Maximum length is 7 because 12345678 could be a file hash.
|
||||||
$href = "comment-{$matches[1]}";
|
$href = "comment-{$matches[1]}";
|
||||||
|
|
|
@ -23,7 +23,7 @@ final class PonderRuleQuestion
|
||||||
extends PhabricatorRemarkupRuleObjectName {
|
extends PhabricatorRemarkupRuleObjectName {
|
||||||
|
|
||||||
protected function getObjectNamePrefix() {
|
protected function getObjectNamePrefix() {
|
||||||
return 'Q';
|
return 'Q(?![1-4]\b)';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue