diff --git a/app/Lib/Tools/ComplexTypeTool.php b/app/Lib/Tools/ComplexTypeTool.php index 1c29d3eb6..5d2f72a99 100644 --- a/app/Lib/Tools/ComplexTypeTool.php +++ b/app/Lib/Tools/ComplexTypeTool.php @@ -322,12 +322,14 @@ class ComplexTypeTool if (preg_match("#^cve-[0-9]{4}-[0-9]{4,9}$#i", $input['raw'])) { return array('types' => array('vulnerability'), 'categories' => array('External analysis'), 'to_ids' => false, 'default_type' => 'vulnerability', 'value' => $input['raw']); } - // Phone numbers - for automatic recognition, needs to start with + or include dashes - if ($input['raw'][0] === '+' || strpos($input['raw'], '-')) { - if (preg_match("#^(\+)?([0-9]{1,3}(\(0\))?)?[0-9\/\-]{5,}[0-9]$#i", $input['raw'])) { - return array('types' => array('phone-number', 'prtn', 'whois-registrant-phone'), 'categories' => array('Other'), 'to_ids' => false, 'default_type' => 'phone-number', 'value' => $input['raw']); - } - } + // Phone numbers - for automatic recognition, needs to start with + or include dashes + if (!empty($input['raw'])) { + if ($input['raw'][0] === '+' || strpos($input['raw'], '-')) { + if (preg_match("#^(\+)?([0-9]{1,3}(\(0\))?)?[0-9\/\-]{5,}[0-9]$#i", $input['raw'])) { + return array('types' => array('phone-number', 'prtn', 'whois-registrant-phone'), 'categories' => array('Other'), 'to_ids' => false, 'default_type' => 'phone-number', 'value' => $input['raw']); + } + } + } } private function __checkForIP($input)