Skip to content

Commit

Permalink
chore: improved PHP 8 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
winternet-studio committed Apr 3, 2024
1 parent ad5e61e commit 23890b8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
20 changes: 13 additions & 7 deletions src/UserException.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,13 +230,19 @@ function __construct($msg, $arrayInternalInfo = [], $options = []) {
}
}

$requestInfo = [
'IP' => $ipAddress . (@$_SERVER['REDIRECT_GEOIP_COUNTRY_NAME'] ? ' '. $_SERVER['REDIRECT_GEOIP_COUNTRY_NAME'] : ''),
'Host' => $host,
$_SERVER['REQUEST_METHOD'] => (!empty($_POST) ? $_POST : file_get_contents('php://input')),
'Referer' => @$_SERVER['HTTP_REFERER'],
'User Agent' => @$_SERVER['HTTP_USER_AGENT'],
];
if (Yii::$app->request->isConsoleRequest) {
$requestInfo = [
'Mode' => 'CLI',
];
} else {
$requestInfo = [
'IP' => $ipAddress . (@$_SERVER['REDIRECT_GEOIP_COUNTRY_NAME'] ? ' '. $_SERVER['REDIRECT_GEOIP_COUNTRY_NAME'] : ''),
'Host' => $host,
$_SERVER['REQUEST_METHOD'] => (!empty($_POST) ? $_POST : file_get_contents('php://input')),
'Referer' => @$_SERVER['HTTP_REFERER'],
'User Agent' => @$_SERVER['HTTP_USER_AGENT'],
];
}
if (!$terminate) {
$requestInfo['Execution terminated'] = $terminate;
$requestInfo['Silent'] = $silent;
Expand Down
4 changes: 2 additions & 2 deletions src/generators/crud2/default/views/_search.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ function toggleSearchMethod() {
// Clear fields we are hiding and reset operator
$('.crud-search-area :input').not(':visible').not('.operator-input').val('');
$('.crud-search-area select.operator-input').find('option').prop('selected', function () {
return $(this).prop('defaultSelected');
}).parent().trigger('change');
return $(this).prop('defaultSelected');
}).parent().trigger('change');
}});
}
$(function() {
Expand Down

0 comments on commit 23890b8

Please sign in to comment.