fix: [audit log] error due to compressible fields not being streams when compression not enabled
parent
3857de8499
commit
370995ab50
|
@ -8,6 +8,7 @@ use Cake\ORM\TableRegistry;
|
|||
use \Cake\Database\Expression\QueryExpression;
|
||||
use Cake\Http\Exception\UnauthorizedException;
|
||||
use Cake\Core\Configure;
|
||||
use PhpParser\Node\Stmt\Echo_;
|
||||
|
||||
class AuditLogsController extends AppController
|
||||
{
|
||||
|
@ -22,8 +23,10 @@ class AuditLogsController extends AppController
|
|||
'filters' => $this->filterFields,
|
||||
'quickFilters' => $this->quickFilterFields,
|
||||
'afterFind' => function($data) {
|
||||
$data['request_ip'] = inet_ntop(stream_get_contents($data['request_ip']));
|
||||
$data['changed'] = stream_get_contents($data['changed']);
|
||||
$request_ip = is_resource($data['request_ip']) ? stream_get_contents($data['request_ip']) : $data['request_ip'];
|
||||
$change = is_resource($data['change']) ? stream_get_contents($data['change']) : $data['change'];
|
||||
$data['request_ip'] = inet_ntop($request_ip);
|
||||
$data['changed'] = $change;
|
||||
return $data;
|
||||
}
|
||||
]);
|
||||
|
|
Loading…
Reference in New Issue