Issues (1270)

public.php (2 issues)

1
<?php
2
    set_include_path(dirname(__FILE__)."/include".PATH_SEPARATOR.
3
        get_include_path());
4
5
    require_once "autoload.php";
6
    require_once "sessions.php";
7
    require_once "functions.php";
8
    require_once "sanity_check.php";
9
    require_once "config.php";
10
    require_once "db.php";
11
    require_once "db-prefs.php";
12
13
    startup_gettext();
0 ignored issues
show
Deprecated Code introduced by
The function startup_gettext() has been deprecated: Loaded in bootstrap ( Ignorable by Annotation )

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

13
    /** @scrutinizer ignore-deprecated */ startup_gettext();

This function has been deprecated. The supplier of the function has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.

Loading history...
14
15
    $script_started = microtime(true);
16
17
    if (!init_plugins()) {
18
        return;
19
    }
20
21
    if (ENABLE_GZIP_OUTPUT && function_exists("ob_gzhandler")) {
0 ignored issues
show
The constant ENABLE_GZIP_OUTPUT was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
22
        ob_start("ob_gzhandler");
23
    }
24
25
    $method = $_REQUEST["op"];
26
27
    $override = PluginHost::getInstance()->lookup_handler("public", $method);
28
29
    if ($override) {
30
        $handler = $override;
31
    } else {
32
        $handler = new Handler_Public($_REQUEST);
33
    }
34
35
    if (implements_interface($handler, "IHandler") && $handler->before($method)) {
36
        if ($method && method_exists($handler, $method)) {
37
            $handler->$method();
38
        } else if (method_exists($handler, 'index')) {
39
            $handler->index();
40
        }
41
        $handler->after();
42
        return;
43
    }
44
45
    header("Content-Type: text/plain");
46
    print error_json(13);
47