Issues (2963)

includes/html/pages/alert-transports.inc.php (1 issue)

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
The method handleOauth() does not exist on Illuminate\Contracts\Foundation\Application. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

15
            if ($transport->/** @scrutinizer ignore-call */ handleOauth($request)) {

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.

Loading history...
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