Skip to content

Commit

Permalink
Merge branch 'develop' into 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
iglocska committed Mar 22, 2024
2 parents 0fb58cf + d39d9b4 commit 8ac96cc
Show file tree
Hide file tree
Showing 30 changed files with 4,228 additions and 3,413 deletions.
2 changes: 1 addition & 1 deletion PyMISP
2 changes: 1 addition & 1 deletion VERSION.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"major":2, "minor":4, "hotfix":187}
{"major":2, "minor":4, "hotfix":188}
6 changes: 3 additions & 3 deletions app/Console/Command/AdminShell.php
Original file line number Diff line number Diff line change
Expand Up @@ -616,9 +616,9 @@ public function redisReady()
try {
$redis = RedisTool::init();
for ($i = 0; $i < 10; $i++) {
$persistence = $redis->info('persistence');
if (isset($persistence['loading']) && $persistence['loading']) {
$this->out('Redis is still loading...');
$pong = $redis->ping();
if ($pong !== true) {
$this->out('Redis is still loading... ' . $pong);
sleep(1);
} else {
break;
Expand Down
2 changes: 1 addition & 1 deletion app/Controller/AppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class AppController extends Controller
public $helpers = array('OrgImg', 'FontAwesome', 'UserName');

private $__queryVersion = '159';
public $pyMispVersion = '2.4.187';
public $pyMispVersion = '2.4.188';
public $phpmin = '7.2';
public $phprec = '7.4';
public $phptoonew = '8.0';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,17 @@ public function supportedEncodings()
private function decodeGzipEncodedContent(Controller $controller)
{
if (function_exists('gzdecode')) {
$decoded = gzdecode($controller->request->input());
$input = $controller->request->input();
if (empty($input)) {
throw new BadRequestException('Request data should be gzip encoded, but request is empty.');
}
$decoded = gzdecode($input);
if ($decoded === false) {
throw new BadRequestException('Invalid compressed data.');
}
return $decoded;
} else {
throw new BadRequestException("This server doesn't support GZIP compressed requests.");
}
throw new BadRequestException("This server doesn't support GZIP compressed requests.");
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/Controller/EventsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3112,9 +3112,9 @@ public function publish($id = null)
$errors['Module'] = 'Module failure.';
}
} else {
$errors['failed_servers'] = $result;
$lastResult = array_pop($result);
$resultString = (count($result) > 0) ? implode(', ', $result) . ' and ' . $lastResult : $lastResult;
$errors['failed_servers'] = $result;
$message = __('Event published but not pushed to %s, re-try later. If the issue persists, make sure that the correct sync user credentials are used for the server link and that the sync user on the remote server has authentication privileges.', $resultString);
}
} else {
Expand Down
5 changes: 4 additions & 1 deletion app/Lib/Tools/CurlClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ private function internalRequest($method, $url, $query, $request)
$options[CURLOPT_POSTFIELDS] = $query;
}

if ($method === 'HEAD') {
$options[CURLOPT_NOBODY] = true;
}

if (!empty($request['header'])) {
$headers = [];
foreach ($request['header'] as $key => $value) {
Expand Down Expand Up @@ -231,7 +235,6 @@ private function internalRequest($method, $url, $query, $request)
}
return $len;
};

if (!curl_setopt_array($this->ch, $options)) {
throw new \RuntimeException('curl error: Could not set options');
}
Expand Down
2 changes: 1 addition & 1 deletion app/Model/AttachmentScan.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ public function scan($type, $attributeId = null, $jobId = null)
$scanned++;
}
} catch (Exception $e) {
$this->logException("Could not scan attachment for $type {$attribute['Attribute']['id']}", $e, LOG_WARNING);
$this->logException("Could not scan attachment for $type {$attribute[$type]['id']}", $e, LOG_WARNING);
$fails++;
}

Expand Down

0 comments on commit 8ac96cc

Please sign in to comment.