Issues (247)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

src/helpers.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
/*
3
 * This file is part of the Laravel Platfourm package.
4
 *
5
 * (c) Avtandil Kikabidze aka LONGMAN <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
use Illuminate\Contracts\Routing\UrlGenerator;
12
13
if (!function_exists('assetver')) {
14
    /**
15
     * Get the path to a versioned Elixir file.
16
     *
17
     * @param  string $file
18
     * @return string
19
     *
20
     * @throws \RuntimeException
21
     * @throws \ErrorException
22
     */
23
    function assetver($file)
24
    {
25
        if (!app()->environment('production')) {
26
            return asset($file);
27
        }
28
29
        $file = preg_replace('#^build\/#', '', $file);
30
31
        static $manifest = null;
32
33
        if ($manifest === null) {
34
            try {
35
                $content = file_get_contents(public_path('build/rev/rev-manifest.json'));
36
            } catch (ErrorException $e) {
37
                throw new ErrorException('rev-manifest.json file not found!');
38
            }
39
40
            $manifest = json_decode($content, true);
41
        }
42
43
        if (isset($manifest[$file])) {
44
            return asset('build/rev/' . $manifest[$file]);
45
        }
46
47
        throw new RuntimeException("File {$file} not defined in asset manifest.");
48
    }
49
}
50
51
if (!function_exists('site_url')) {
52
    /**
53
     * Generate a url for the application.
54
     *
55
     * @param  string $path
56
     * @param  mixed  $parameters
57
     * @param  bool   $secure
58
     * @return Illuminate\Contracts\Routing\UrlGenerator|string
59
     */
60
    function site_url($path = null, $parameters = [], $secure = null)
61
    {
62
        if (is_null($path)) {
63
            return app(UrlGenerator::class);
64
        }
65
66
        return lang_url($path, $parameters, $secure);
67
    }
68
}
69
70
if (!function_exists('admin_url')) {
71
    /**
72
     * Generate a url for the application.
73
     *
74
     * @param  string $path
75
     * @param  mixed  $parameters
76
     * @param  bool   $secure
77
     * @return Illuminate\Contracts\Routing\UrlGenerator|string
78
     */
79
    function admin_url($path = null, $parameters = [], $secure = null)
0 ignored issues
show
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
80
    {
81
        if (is_null($path)) {
82
            return app(UrlGenerator::class);
83
        }
84
85
        $prefix = config('platfourm.admin_prefix', 'admin');
86
        if ($prefix) {
87
            $path = $prefix . '/' . $path;
88
        }
89
90
        return site_url($path, $parameters, $secure);
91
    }
92
}
93
94
if (!function_exists('p')) {
95
    /**
96
     * Generate a url for the application.
97
     *
98
     * @param  mixed $value
99
     */
100
    function p($value)
101
    {
102
        $debugbar = app('debugbar');
103
        foreach (func_get_args() as $value) {
104
            $debugbar->addMessage($value, 'debug');
105
        }
106
    }
107
}
108
109
if (!function_exists('array_to_subarray')) {
110
    /**
111
     * Generate a url for the application.
112
     *
113
     * @param  array $array
114
     * @return  array
115
     */
116
    function array_to_subarray(array $array)
117
    {
118
        $return = [];
119
        foreach ($array as $k => $v) {
120
            $return[] = [
121
                'id'   => $k,
122
                'name' => $v,
123
            ];
124
        }
125
126
        return $return;
127
    }
128
}
129
130
if (!function_exists('j')) {
131
    function j($value)
132
    {
133
        return json_encode($value, JSON_UNESCAPED_UNICODE);
134
    }
135
}
136
137
if (!function_exists('e')) {
138
    function e($value)
139
    {
140
        return htmlspecialchars($value);
141
    }
142
}
143
144
if (!function_exists('a')) {
145
    function a($value)
146
    {
147
        return e(j($value));
148
    }
149
}
150