1
0
Fork 0
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:
vrana 2012-10-22 11:05:44 -07:00
parent c24f4411c1
commit 89b9d56cbe
2 changed files with 6 additions and 7 deletions

View file

@ -27,18 +27,17 @@ abstract class PhabricatorRemarkupRuleObjectName
public function apply($text) {
$prefix = $this->getObjectNamePrefix();
return preg_replace_callback(
"@\b{$prefix}(\d+)(?:#([-\w\d]+))?\b@",
"@\b({$prefix})([1-9]\d*)(?:#([-\w\d]+))?\b@",
array($this, 'markupObjectNameLink'),
$text);
}
public function markupObjectNameLink($matches) {
$prefix = $this->getObjectNamePrefix();
$id = $matches[1];
list(, $prefix, $id) = $matches;
if (isset($matches[2])) {
$href = $matches[2];
$text = $matches[2];
if (isset($matches[3])) {
$href = $matches[3];
$text = $matches[3];
if (preg_match('@^(?:comment-)?(\d{1,7})$@', $href, $matches)) {
// Maximum length is 7 because 12345678 could be a file hash.
$href = "comment-{$matches[1]}";

View file

@ -23,7 +23,7 @@ final class PonderRuleQuestion
extends PhabricatorRemarkupRuleObjectName {
protected function getObjectNamePrefix() {
return 'Q';
return 'Q(?![1-4]\b)';
}
}