mirror of
https://github.com/reactos/mattermost-extensions.git
synced 2024-11-23 03:39:53 +00:00
Fix PR command without '#'
This commit is contained in:
parent
49a2c382b5
commit
3509efc213
@ -37,7 +37,7 @@ class Pr extends Mattermost
|
||||
return false;
|
||||
|
||||
// Do our own validation
|
||||
if (!preg_match('/^([a-z0-9-_]*)#?([0-9]+)$/i', $this->arg, $matches))
|
||||
if (!preg_match('/^([a-z0-9-_]*?)#?([0-9]+)$/i', $this->arg, $matches))
|
||||
{
|
||||
$this->result['text'] = 'Invalid PR number';
|
||||
return false;
|
||||
|
@ -176,6 +176,11 @@ $tests = array(
|
||||
'expect' => array('text' => "@ requested `/pr #1`:\n" . $pr_url . "reactos/pull/" . "1"),
|
||||
'post' => array('token' => $config['pr_token'], 'text' => '#1'),
|
||||
),
|
||||
array(
|
||||
'name' => 'Pr',
|
||||
'expect' => array('text' => "@ requested `/pr 1234`:\n" . $pr_url . "reactos/pull/" . "1234"),
|
||||
'post' => array('token' => $config['pr_token'], 'text' => '1234'),
|
||||
),
|
||||
array(
|
||||
'name' => 'Pr',
|
||||
'expect' => array('text' => "@ requested `/pr rapps-db#333333`:\n" . $pr_url . "rapps-db/pull/" . "333333"),
|
||||
|
Loading…
Reference in New Issue
Block a user