mirror of https://github.com/MISP/MISP
parent
2215f1a579
commit
3dec0d997b
|
@ -18,7 +18,6 @@ class BlacklistBehavior extends ModelBehavior {
|
|||
public function setup(Model $Model, $settings = array()) {
|
||||
if (!isset($this->settings[$Model->alias])) {
|
||||
$this->settings[$Model->alias] = array(
|
||||
'fields' => array(),
|
||||
);
|
||||
}
|
||||
$this->settings[$Model->alias] = array_merge(
|
||||
|
@ -46,8 +45,7 @@ class BlacklistBehavior extends ModelBehavior {
|
|||
public function blacklistStringFields(Model $Model) {
|
||||
$returnValue = true;
|
||||
foreach ($Model->data[$Model->name] as $key => $field) {
|
||||
if ($returnValue && is_string($field)) {
|
||||
//if ($returnValue && in_array($key, $this->settings[$Model->alias]['fields']) && is_string($field)) { // TODO fields
|
||||
if ($returnValue && in_array($key, $this->settings[$Model->alias]['fields']) && is_string($field)) { // TODO fields
|
||||
$returnValue = $this->replaceWindowsSpecific($Model, $field);
|
||||
}
|
||||
}
|
||||
|
@ -64,7 +62,7 @@ class BlacklistBehavior extends ModelBehavior {
|
|||
public function replaceWindowsSpecific(Model $Model, $string) {
|
||||
$returnValue = true;
|
||||
$blacklist = new Blacklist();
|
||||
$allBlacklist = $blacklist->find('all'); // TODO REGEXP INIT LOAD ARRAY
|
||||
$allBlacklist = $blacklist->find('all'); // TODO INIT LOAD ARRAY
|
||||
foreach ($allBlacklist as $item) {
|
||||
if ($item['Blacklist']['name'] == $string) {
|
||||
App::uses('SessionComponent', 'Controller/Component');
|
||||
|
|
|
@ -66,7 +66,7 @@ class RegexpBehavior extends ModelBehavior {
|
|||
public function replaceWindowsSpecific(Model $Model, $string) {
|
||||
$returnValue = true;
|
||||
$regexp = new Regexp();
|
||||
$allRegexp = $regexp->find('all'); // TODO REGEXP INIT LOAD ARRAY
|
||||
$allRegexp = $regexp->find('all'); // TODO INIT LOAD ARRAY
|
||||
foreach ($allRegexp as $regexp) {
|
||||
if (strlen($regexp['Regexp']['replacement'] && strlen($regexp['Regexp']['regexp']))) {
|
||||
$string = preg_replace($regexp['Regexp']['regexp'], $regexp['Regexp']['replacement'], $string);
|
||||
|
|
Loading…
Reference in New Issue