new: [freetext import] Added detection for AS

pull/3711/head
iglocska 2018-09-23 11:43:55 +02:00
parent c0f1e80465
commit cefab3e01c
1 changed files with 9 additions and 1 deletions

View File

@ -228,7 +228,7 @@ class ComplexTypeTool
);
// algorithms to run through in order
private $__checks = array('Hashes', 'Email', 'IP', 'DomainOrFilename', 'SimpleRegex');
private $__checks = array('Hashes', 'Email', 'IP', 'DomainOrFilename', 'SimpleRegex', 'AS');
private function __resolveType($raw_input)
{
@ -258,6 +258,14 @@ class ComplexTypeTool
return false;
}
private function __checkForAS($input)
{
if (preg_match('#^as[0-9]+$#i', $input['raw'])) {
$input['raw'] = strtoupper($input['raw']);
return array('types' => array('AS'), 'to_ids' => false, 'default_type' => 'AS', 'value' => $input['raw']);
}
}
private function __checkForHashes($input)
{
// handle prepared composite values with the filename|hash format