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.

blocks/category_events.php (6 issues)

1
<?php
2
/*
3
 * You may not change or alter any portion of this comment or credits
4
 * of supporting developers from this source code or any supporting source code
5
 * which is considered copyrighted (c) material of the original comment or credit authors.
6
 *
7
 * This program is distributed in the hope that it will be useful,
8
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
 */
11
12
/**
13
 * @copyright    {@link https://xoops.org/ XOOPS Project}
14
 * @license      {@link https://www.gnu.org/licenses/gpl-2.0.html GNU GPL 2 or later}
15
 * @package      extcal
16
 * @since
17
 * @author       XOOPS Development Team,
18
 */
19
20
use XoopsModules\Extcal\{Helper,
21
    EventHandler,
22
    CategoryHandler
23
};
24
25
require_once dirname(__DIR__) . '/include/constantes.php';
26
27
/******************************************************/
28
/* Ajour JJD - Evenements par categries               */
29
/******************************************************/
30
/**
31
 * @param $options
32
 *
33
 * @return array|bool
34
 */
35
function bExtcalUpcomingByCategoryShow($options)
36
{
37
    global $xoopsUser;
38
39
    /** @var Helper $helper */
40
    if (!class_exists(Helper::class)) {
41
        return false;
42
    }
43
44
    $helper = Helper::getInstance();
45
    $helper->loadLanguage('main');
46
47
    $eventHandler = $helper->getHandler(_EXTCAL_CLN_EVENT);
48
49
    $nbEvent     = $options[0];
50
    $titleLenght = $options[1];
0 ignored issues
show
The assignment to $titleLenght is dead and can be removed.
Loading history...
51
    array_shift($options);
52
    array_shift($options);
53
54
    // Checking if no cat is selected
55
    if (isset($options[0]) && 0 == $options[0] && 1 == count($options)) {
56
        $options = 0;
57
    }
58
59
    $events = $eventHandler->objectToArray($eventHandler->getUpcommingEvent($nbEvent, $options));
0 ignored issues
show
The method objectToArray() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of XoopsObjectHandler such as XoopsPersistableObjectHandler. ( Ignorable by Annotation )

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

59
    /** @scrutinizer ignore-call */ 
60
    $events = $eventHandler->objectToArray($eventHandler->getUpcommingEvent($nbEvent, $options));
Loading history...
The method getUpcommingEvent() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of XoopsObjectHandler such as XoopsPersistableObjectHandler. ( Ignorable by Annotation )

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

59
    $events = $eventHandler->objectToArray($eventHandler->/** @scrutinizer ignore-call */ getUpcommingEvent($nbEvent, $options));
Loading history...
60
    $eventHandler->serverTimeToUserTimes($events);
0 ignored issues
show
The method serverTimeToUserTimes() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of XoopsObjectHandler such as XoopsPersistableObjectHandler. ( Ignorable by Annotation )

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

60
    $eventHandler->/** @scrutinizer ignore-call */ 
61
                   serverTimeToUserTimes($events);
Loading history...
61
    $eventHandler->formatEventsDate($events, $helper->getConfig('event_date_month'));
0 ignored issues
show
The method formatEventsDate() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of XoopsObjectHandler such as XoopsPersistableObjectHandler. ( Ignorable by Annotation )

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

61
    $eventHandler->/** @scrutinizer ignore-call */ 
62
                   formatEventsDate($events, $helper->getConfig('event_date_month'));
Loading history...
62
63
    /***********************************************************/
64
    $categoryHandler = $helper->getHandler(_EXTCAL_CLN_CAT);
65
    $t               = $categoryHandler->objectToArray($categoryHandler->getAllCat($xoopsUser, 'all'));
0 ignored issues
show
The method getAllCat() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of XoopsObjectHandler such as XoopsPersistableObjectHandler. ( Ignorable by Annotation )

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

65
    $t               = $categoryHandler->objectToArray($categoryHandler->/** @scrutinizer ignore-call */ getAllCat($xoopsUser, 'all'));
Loading history...
66
    $tCats           = [];
67
    foreach ($t as $h => $hValue) {
68
        $tCats[$t[$h]['cat_id']] = $hValue;
69
    }
70
71
    $te = [];
72
73
    foreach ($events as $h => $hValue) {
74
        $catId = $events[$h]['cat_id'];
75
        if (!isset($te[$catId])) {
76
            $te[$catId]           = $tCats[$catId];
77
            $te[$catId]['events'] = [];
78
        }
79
        $te[$catId]['events'][] = $hValue;
80
    }
81
82
    return $te;
83
}
84
85
/**
86
 * @param $options
87
 *
88
 * @return string
89
 */
90
function bExtcalUpcomingByCategoryEdit($options)
91
{
92
    global $xoopsUser;
93
94
    $helper          = Helper::getInstance();
95
    $categoryHandler = $helper->getHandler(_EXTCAL_CLN_CAT);
96
97
    $cats = $categoryHandler->getAllCat($xoopsUser, 'extcal_cat_view');
98
99
    $form = _MB_EXTCAL_DISPLAY . "&nbsp;\n";
100
    $form .= '<input name="options[0]" size="5" maxlength="255" value="' . $options[0] . '" type="text">&nbsp;' . _MB_EXTCAL_EVENT . '<br>';
101
    $form .= _MB_EXTCAL_TITLE_LENGTH . ' : <input name="options[1]" size="5" maxlength="255" value="' . $options[1] . '" type="text"><br>';
102
    array_shift($options);
103
    array_shift($options);
104
    $form .= _MB_EXTCAL_CAT_TO_USE . '<br><select name="options[]" multiple="multiple" size="5">';
105
    if (false === array_search(0, $options, true)) {
106
        $form .= '<option value="0">' . _MB_EXTCAL_ALL_CAT . '</option>';
107
    } else {
108
        $form .= '<option value="0" selected="selected">' . _MB_EXTCAL_ALL_CAT . '</option>';
109
    }
110
    foreach ($cats as $cat) {
111
        if (false === array_search($cat->getVar('cat_id'), $options, true)) {
112
            $form .= '<option value="' . $cat->getVar('cat_id') . '">' . $cat->getVar('cat_name') . '</option>';
113
        } else {
114
            $form .= '<option value="' . $cat->getVar('cat_id') . '" selected="selected">' . $cat->getVar('cat_name') . '</option>';
115
        }
116
    }
117
    $form .= '</select>';
118
119
    return $form;
120
}
121