@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Detect macros more strictly in bot handler

Summary: Fixes T5863. Like Remarkup, only identify macros if the entire chat line is the macro.

Test Plan: https://secure.phabricator.com/chatlog/channel/6/?at=158229

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5863

Differential Revision: https://secure.phabricator.com/D10242

+2 -2
+2 -2
src/infrastructure/daemon/bot/handler/PhabricatorBotMacroHandler.php
··· 31 31 foreach ($macros as $macro_name => $macro) { 32 32 $regexp[] = preg_quote($macro_name, '/'); 33 33 } 34 - $regexp = '/('.implode('|', $regexp).')/'; 34 + $regexp = '/^('.implode('|', $regexp).')\z/'; 35 35 36 36 $this->macros = $macros; 37 37 $this->regexp = $regexp; ··· 49 49 $message_body = $message->getBody(); 50 50 51 51 $matches = null; 52 - if (!preg_match($this->regexp, $message_body, $matches)) { 52 + if (!preg_match($this->regexp, trim($message_body), $matches)) { 53 53 return; 54 54 } 55 55