Merge remote-tracking branch 'upstream/2.4' into 2.4

pull/3474/head
Steve Clement 2018-07-11 20:39:47 +02:00
commit 36a8c1849b
2 changed files with 10 additions and 3 deletions

View File

@ -270,8 +270,10 @@ class ComplexTypeTool {
private function __checkForSimpleRegex($input) {
// CVE numbers
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
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 ($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) {

View File

@ -398,7 +398,7 @@ class Server extends AppModel {
'attachments_dir' => array(
'level' => 2,
'description' => 'Directory where attachments are stored. MISP will NOT migrate the existing data if you change this setting. The only safe way to change this setting is in config.php, when MISP is not running, and after having moved/copied the existing data to the new location. This directory must already exist and be writable and readable by the MISP application.',
'value' => '/var/www/MISP/app/' . 'files', # GUI display purpose only. Default value defined in func getDefaultAttachments_dir()
'value' => '', # GUI display purpose only. Default value defined in func getDefaultAttachments_dir()
'errorMessage' => '',
'null' => false,
'test' => 'testForWritableDir',
@ -1697,6 +1697,11 @@ class Server extends AppModel {
'Session' => 'Security'
);
public function __construct($id = false, $table = null, $ds = null) {
parent::__construct($id, $table, $ds);
$this->serverSettings['MISP']['attachments_dir']['value'] = APP . '/files';
}
public $validEventIndexFilters = array('searchall', 'searchpublished', 'searchorg', 'searchtag', 'searcheventid', 'searchdate', 'searcheventinfo', 'searchthreatlevel', 'searchdistribution', 'searchanalysis', 'searchattribute');
public function isOwnedByOrg($serverid, $org) {