Issues (1844)

Security Analysis    not enabled

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

  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.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
  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.
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  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.
  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.
  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.
  Header Injection
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.

vendor/amenadiel/jpgraph/src/graph/LogScale.php (5 issues)

1
<?php
2
3
/**
4
 * JPGraph v4.0.3
5
 */
6
7
namespace Amenadiel\JpGraph\Graph;
8
9
use Amenadiel\JpGraph\Util;
10
11
/*
12
 * File:        JPGRAPH_LOG.PHP
13
 * // Description: Log scale plot extension for JpGraph
14
 * // Created:     2001-01-08
15
 * // Ver:         $Id: jpgraph_log.php 1106 2009-02-22 20:16:35Z ljp $
16
 * //
17
 * // Copyright (c) Asial Corporation. All rights reserved.
18
 */
19
define('LOGLABELS_PLAIN', 0);
20
define('LOGLABELS_MAGNITUDE', 1);
21
22
/**
23
 * @class LogScale
24
 * // Description: Logarithmic scale between world and screen
25
 */
26
class LogScale extends LinearScale
27
{
28
    /**
29
     * CONSTRUCTOR.
30
     *
31
     * @param mixed $min
32
     * @param mixed $max
33
     * @param mixed $type
34
     */
35
    // Log scale is specified using the log of min and max
36
    public function __construct($min, $max, $type = 'y')
37
    {
38
        parent::__construct($min, $max, $type);
39
        $this->ticks = new LogTicks('log');
40
        $this->name  = 'log';
41
    }
42
43
    /**
44
     * PUBLIC METHODS.
45
     *
46
     * @param mixed $a
47
     */
48
    // Translate between world and screen
49
    public function Translate($a)
50
    {
51
        if (!is_numeric($a)) {
52
            if ($a != '' && $a != '-' && $a != 'x') {
53
                Util\JpGraphError::RaiseL(11001);
54
                // ('Your data contains non-numeric values.');
55
            }
56
57
            return 1;
58
        }
59
        if ($a < 0) {
60
            Util\JpGraphError::RaiseL(11002);
61
            //("Negative data values can not be used in a log scale.");
62
            exit(1);
0 ignored issues
show
Using exit here is not recommended.

In general, usage of exit should be done with care and only when running in a scripting context like a CLI script.

Loading history...
63
        }
64
        if ($a == 0) {
65
            $a = 1;
66
        }
67
68
        $a = log10($a);
69
70
        return ceil($this->off + ($a * 1.0 - $this->scale[0]) * $this->scale_factor);
71
    }
72
73
    // Relative translate (don't include offset) usefull when we just want
74
    // to know the relative position (in pixels) on the axis
75
    public function RelTranslate($a)
76
    {
77
        if (!is_numeric($a)) {
78
            if ($a != '' && $a != '-' && $a != 'x') {
79
                Util\JpGraphError::RaiseL(11001);
80
                //('Your data contains non-numeric values.');
81
            }
82
83
            return 1;
84
        }
85
        if ($a == 0) {
86
            $a = 1;
87
        }
88
        $a = log10($a);
89
90
        return round(($a * 1.0 - $this->scale[0]) * $this->scale_factor);
91
    }
92
93
    // Use bcpow() for increased precision
94
    public function GetMinVal()
95
    {
96
        if (function_exists('bcpow')) {
97
            return round(bcpow(10, $this->scale[0], 15), 14);
0 ignored issues
show
bcpow(10, $this->scale[0], 15) of type string is incompatible with the type double|integer expected by parameter $num of round(). ( Ignorable by Annotation )

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

97
            return round(/** @scrutinizer ignore-type */ bcpow(10, $this->scale[0], 15), 14);
Loading history...
98
        }
99
100
        return round(pow(10, $this->scale[0]), 14);
101
    }
102
103
    public function GetMaxVal()
104
    {
105
        if (function_exists('bcpow')) {
106
            return round(bcpow(10, $this->scale[1], 15), 14);
0 ignored issues
show
bcpow(10, $this->scale[1], 15) of type string is incompatible with the type double|integer expected by parameter $num of round(). ( Ignorable by Annotation )

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

106
            return round(/** @scrutinizer ignore-type */ bcpow(10, $this->scale[1], 15), 14);
Loading history...
107
        }
108
109
        return round(pow(10, $this->scale[1]), 14);
110
    }
111
112
    // Logarithmic autoscaling is much simplier since we just
113
    // set the min and max to logs of the min and max values.
114
    // Note that for log autoscale the "maxstep" the fourth argument
115
    // isn't used. This is just included to give the method the same
116
    // signature as the linear counterpart.
117
    public function AutoScale($img, $min, $max, $maxsteps, $majend = true)
118
    {
119
        if ($min == 0) {
120
            $min = 1;
121
        }
122
123
        if ($max <= 0) {
124
            Util\JpGraphError::RaiseL(11004);
125
            //('Scale error for logarithmic scale. You have a problem with your data values. The max value must be greater than 0. It is mathematically impossible to have 0 in a logarithmic scale.');
126
        }
127
        if (is_numeric($this->autoscale_min)) {
0 ignored issues
show
The condition is_numeric($this->autoscale_min) is always false.
Loading history...
128
            $smin = round($this->autoscale_min);
129
            $smax = ceil(log10($max));
130
            if ($min >= $max) {
131
                Util\JpGraphError::RaiseL(25071); //('You have specified a min value with SetAutoMin() which is larger than the maximum value used for the scale. This is not possible.');
132
            }
133
        } else {
134
            $smin = floor(log10($min));
135
            if (is_numeric($this->autoscale_max)) {
0 ignored issues
show
The condition is_numeric($this->autoscale_max) is always false.
Loading history...
136
                $smax = round($this->autoscale_max);
137
                if ($smin >= $smax) {
138
                    Util\JpGraphError::RaiseL(25072); //('You have specified a max value with SetAutoMax() which is smaller than the miminum value used for the scale. This is not possible.');
139
                }
140
            } else {
141
                $smax = ceil(log10($max));
142
            }
143
        }
144
145
        $this->Update($img, $smin, $smax);
146
    }
147
148
    /*
149
     * PRIVATE METHODS
150
     */
151
} // @class
152