Changeset View
Changeset View
Standalone View
Standalone View
src/parser/PhutilBugtraqParser.php
Show First 20 Lines • Show All 79 Lines • ▼ Show 20 Lines | public function processCorpus($corpus) { | ||||
// If there's no selection expression, we use the entire match. | // If there's no selection expression, we use the entire match. | ||||
$bug_ids = array(); | $bug_ids = array(); | ||||
$select_regexp = $this->bugtraqSelectExpression; | $select_regexp = $this->bugtraqSelectExpression; | ||||
foreach ($captures as $capture) { | foreach ($captures as $capture) { | ||||
$captured_text = $capture['text']; | $captured_text = $capture['text']; | ||||
$captured_offset = $capture['at']; | $captured_offset = $capture['at']; | ||||
if (strlen($select_regexp)) { | if ($select_regexp !== null) { | ||||
$selections = null; | $selections = null; | ||||
preg_match_all( | preg_match_all( | ||||
$select_regexp, | $select_regexp, | ||||
$captured_text, | $captured_text, | ||||
$selections, | $selections, | ||||
PREG_OFFSET_CAPTURE); | PREG_OFFSET_CAPTURE); | ||||
foreach ($selections[1] as $selection) { | foreach ($selections[1] as $selection) { | ||||
Show All 33 Lines |