Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/markup/PhabricatorMarkupEngine.php
Show First 20 Lines • Show All 577 Lines • ▼ Show 20 Lines | public static function extractPHIDsFromMentions( | ||||
array $content_blocks) { | array $content_blocks) { | ||||
$mentions = array(); | $mentions = array(); | ||||
$engine = self::newDifferentialMarkupEngine(); | $engine = self::newDifferentialMarkupEngine(); | ||||
$engine->setConfig('viewer', $viewer); | $engine->setConfig('viewer', $viewer); | ||||
foreach ($content_blocks as $content_block) { | foreach ($content_blocks as $content_block) { | ||||
if ($content_block === null) { | |||||
continue; | |||||
} | |||||
if (!strlen($content_block)) { | |||||
continue; | |||||
} | |||||
$engine->markupText($content_block); | $engine->markupText($content_block); | ||||
$phids = $engine->getTextMetadata( | $phids = $engine->getTextMetadata( | ||||
PhabricatorMentionRemarkupRule::KEY_MENTIONED, | PhabricatorMentionRemarkupRule::KEY_MENTIONED, | ||||
array()); | array()); | ||||
$mentions += $phids; | $mentions += $phids; | ||||
} | } | ||||
return $mentions; | return $mentions; | ||||
▲ Show 20 Lines • Show All 122 Lines • Show Last 20 Lines |