diff --git a/app/Libraries/Utils.php b/app/Libraries/Utils.php index 8edc5fae9e05..79bc158a8d9d 100644 --- a/app/Libraries/Utils.php +++ b/app/Libraries/Utils.php @@ -431,14 +431,12 @@ class Utils public static function prepareErrorData($context) { - return [ + $data = [ 'context' => $context, 'user_id' => Auth::check() ? Auth::user()->id : 0, 'account_id' => Auth::check() ? Auth::user()->account_id : 0, 'user_name' => Auth::check() ? Auth::user()->getDisplayName() : '', 'method' => Request::method(), - 'url' => Input::get('url', Request::url()), - 'previous' => url()->previous(), 'user_agent' => isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '', 'locale' => App::getLocale(), 'ip' => Request::getClientIp(), @@ -447,6 +445,15 @@ class Utils 'is_api' => session('token_id') ? 'yes' : 'no', 'db_server' => config('database.default'), ]; + + if (static::isNinja()) { + $data['url'] = Input::get('url', Request::url()); + $data['previous'] = url()->previous(); + } else { + $data['url'] = request()->path(); + } + + return $data; } public static function getErrors()