#5791: Address errors found by lgtm.com #7403
The website LGTM.com has detected a few errors from static analysis. This patch contains a possible fix for the first of them ("URL redirection from remote source") that follows the website's own recommendation: Check the input against some known source before using it. I've checked that the dashboard ID provided actually exists in DB and if it doesn't I return a 404.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
I've written a unit test that can be run e.g. like:
Please @mistercrunch as original reporter but feel free to re-assign as you see fit.
@@ Coverage Diff @@ ## master #7403 +/- ## ========================================== + Coverage 65.78% 65.81% +0.02% ========================================== Files 459 459 Lines 21924 21921 -3 Branches 2411 2409 -2 ========================================== + Hits 14423 14427 +4 + Misses 7380 7374 -6 + Partials 121 120 -1