1 | <?php |
||
2 | |||
3 | // handle OAuth requests |
||
4 | $request = request(); // grab the Request object |
||
5 | |||
6 | if ($request->has('oauthtransport')) { |
||
7 | // make sure transport is safe |
||
8 | $validator = Validator::make($request->all(), ['oauthtransport' => 'required|alpha']); |
||
9 | |||
10 | if ($validator->passes()) { |
||
11 | $transport_name = $request->get('oauthtransport'); |
||
12 | $class = 'LibreNMS\\Alert\\Transport\\' . $transport_name; |
||
13 | if (class_exists($class)) { |
||
14 | $transport = app($class); |
||
15 | if ($transport->handleOauth($request)) { |
||
0 ignored issues
–
show
|
|||
16 | Toastr::success("$transport_name added successfully."); |
||
17 | } else { |
||
18 | Toastr::error("$transport_name was not added. Check the log for details."); |
||
19 | } |
||
20 | } |
||
21 | } |
||
22 | |||
23 | // remove get variables otherwise things will get double added |
||
24 | echo '<script>window.history.replaceState(null, null, window.location.pathname);</script>'; |
||
25 | } |
||
26 | unset($request); |
||
27 | |||
28 | // print alert transports |
||
29 | require_once 'includes/html/print-alert-transports.php'; |
||
30 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.