Issues (733)

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.

class/pear/Calendar/Month.php (1 issue)

1
<?php
2
3
/* vim: set expandtab tabstop=4 shiftwidth=4: */
4
5
/**
6
 * Contains the Calendar_Month class.
7
 *
8
 * PHP versions 4 and 5
9
 *
10
 * LICENSE: Redistribution and use in source and binary forms, with or without
11
 * modification, are permitted provided that the following conditions are met:
12
 * 1. Redistributions of source code must retain the above copyright
13
 *    notice, this list of conditions and the following disclaimer.
14
 * 2. Redistributions in binary form must reproduce the above copyright
15
 *    notice, this list of conditions and the following disclaimer in the
16
 *    documentation and/or other materials provided with the distribution.
17
 * 3. The name of the author may not be used to endorse or promote products
18
 *    derived from this software without specific prior written permission.
19
 *
20
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
21
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
22
 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23
 * IN NO EVENT SHALL THE FREEBSD PROJECT OR CONTRIBUTORS BE LIABLE FOR ANY
24
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
 *
31
 * @category  Date and Time
32
 *
33
 * @author    Harry Fuecks <[email protected]>
34
 * @copyright 2003-2007 Harry Fuecks
35
 * @license   http://www.debian.org/misc/bsd.license  BSD License (3 Clause)
36
 *
37
 * @link      http://pear.php.net/package/Calendar
38
 */
39
40
/**
41
 * Allows Calendar include path to be redefined.
42
 *
43
 * @ignore
44
 */
45
if (!defined('CALENDAR_ROOT')) {
46
    define('CALENDAR_ROOT', 'Calendar/');
47
}
48
49
/**
50
 * Load Calendar base class.
51
 */
52
require_once CALENDAR_ROOT . 'Calendar.php';
53
54
/**
55
 * Represents a Month and builds Days
56
 * <code>
57
 * require_once __DIR__ . '/Calendar/Month.php';
58
 * $Month = new Calendar_Month(2003, 10); // Oct 2003
59
 * $Month->build(); // Build Calendar_Day objects
60
 * while (false !== ($Day = $Month->fetch())) {
61
 *     echo $Day->thisDay().'<br>';
62
 * }
63
 * </code>.
64
 *
65
 * @category  Date and Time
66
 *
67
 * @author    Harry Fuecks <[email protected]>
68
 * @copyright 2003-2007 Harry Fuecks
69
 * @license   http://www.debian.org/misc/bsd.license  BSD License (3 Clause)
70
 *
71
 * @link      http://pear.php.net/package/Calendar
72
 */
73
class Calendar_Month extends Calendar
74
{
75
    /**
76
     * Constructs Calendar_Month.
77
     *
78
     * @param int $y        year e.g. 2003
79
     * @param int $m        month e.g. 5
80
     * @param int $firstDay first day of the week [optional]
81
     */
82
    public function __construct($y, $m, $firstDay = null)
83
    {
84
        parent::__construct($y, $m);
85
        $this->firstDay = $this->defineFirstDayOfWeek($firstDay);
0 ignored issues
show
Bug Best Practice introduced by
The property firstDay does not exist. Although not strictly required by PHP, it is generally a best practice to declare properties explicitly.
Loading history...
86
    }
87
88
    /**
89
     * Builds Day objects for this Month. Creates as many Calendar_Day objects
90
     * as there are days in the month.
91
     *
92
     * @param array $sDates (optional) Calendar_Day objects representing selected dates
93
     *
94
     * @return bool
95
     */
96
    public function build($sDates = [])
97
    {
98
        require_once CALENDAR_ROOT . 'Day.php';
99
        $daysInMonth = $this->cE->getDaysInMonth($this->year, $this->month);
100
        for ($i = 1; $i <= $daysInMonth; ++$i) {
101
            $this->children[$i] = new Calendar_Day($this->year, $this->month, $i);
102
        }
103
        if (count($sDates) > 0) {
104
            $this->setSelection($sDates);
105
        }
106
107
        return true;
108
    }
109
110
    /**
111
     * Called from build().
112
     *
113
     * @param array $sDates Calendar_Day objects representing selected dates
114
     * @return bool|void
115
     */
116
    public function setSelection($sDates)
117
    {
118
        foreach ($sDates as $sDate) {
119
            if ($this->year == $sDate->thisYear() && $this->month == $sDate->thisMonth()) {
120
                $key = $sDate->thisDay();
121
                if (isset($this->children[$key])) {
122
                    $sDate->setSelected();
123
                    $class = mb_strtolower(get_class($sDate));
124
                    if ('calendar_day' === $class || 'calendar_decorator' === $class) {
125
                        $sDate->setFirst($this->children[$key]->isFirst());
126
                        $sDate->setLast($this->children[$key]->isLast());
127
                    }
128
                    $this->children[$key] = $sDate;
129
                }
130
            }
131
        }
132
    }
133
}
134