A free open source IT asset/license management system
Grumble grumble grumble codacy
snipe2c6e0283f473
diff --git a/app/Http/Controllers/Accessories/AccessoriesController.php b/app/Http/Controllers/Accessories/AccessoriesController.phpindex bf1b008d0a..a489fe144d 100755--- a/app/Http/Controllers/Accessories/AccessoriesController.php+++ b/app/Http/Controllers/Accessories/AccessoriesController.php@@ -279,6 +279,6 @@ class AccessoriesController extends Controller// #history for the confirmation loop, and sends index-page// opens back to the index so bulk adjust flows aren't broken// by a forced navigation to the item detail page.- return $this->adjustQuantityRedirect($request, $accessory, route('accessories.show', $accessory));+ return $this->adjustQuantityRedirect($request, route('accessories.show', $accessory));}}diff --git a/app/Http/Controllers/Components/ComponentsController.php b/app/Http/Controllers/Components/ComponentsController.phpindex 8f002c2205..87f0e73c8c 100644--- a/app/Http/Controllers/Components/ComponentsController.php+++ b/app/Http/Controllers/Components/ComponentsController.php@@ -273,6 +273,6 @@ class ComponentsController extends Controller// See AccessoriesController::adjustQuantity — helper picks// between show-page-#history and back-to-referer.- return $this->adjustQuantityRedirect($request, $component, route('components.show', $component));+ return $this->adjustQuantityRedirect($request, route('components.show', $component));}}diff --git a/app/Http/Controllers/Consumables/ConsumablesController.php b/app/Http/Controllers/Consumables/ConsumablesController.phpindex 1d1eeb1c29..97d5fdd17e 100644--- a/app/Http/Controllers/Consumables/ConsumablesController.php+++ b/app/Http/Controllers/Consumables/ConsumablesController.php@@ -275,6 +275,6 @@ class ConsumablesController extends Controller// See AccessoriesController::adjustQuantity — helper picks// between show-page-#history and back-to-referer.- return $this->adjustQuantityRedirect($request, $consumable, route('consumables.show', $consumable));+ return $this->adjustQuantityRedirect($request, route('consumables.show', $consumable));}}diff --git a/app/Http/Traits/HandlesAdjustQuantity.php b/app/Http/Traits/HandlesAdjustQuantity.phpindex c2af00019b..10969b4826 100644--- a/app/Http/Traits/HandlesAdjustQuantity.php+++ b/app/Http/Traits/HandlesAdjustQuantity.php@@ -71,7 +71,7 @@ trait HandlesAdjustQuantity* as same-origin to prevent open-redirect abuse; missing or* cross-origin referers fall back to the item show page.*/- protected function adjustQuantityRedirect(Request $request, Model $model, string $itemShowUrl): RedirectResponse+ protected function adjustQuantityRedirect(Request $request, string $itemShowUrl): RedirectResponse{$referer = Helper::sameOriginUrl($request->headers->get('referer'));$success = trans('general.adjust_quantity_success');