Issues (181)

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.

plugins/tplleaguestats.php (6 issues)

1
<?php declare(strict_types=1);
2
/**
3
 * ****************************************************************************
4
 * marquee - MODULE FOR XOOPS
5
 * Copyright (c) Hervé Thouzard (https://www.herve-thouzard.com)
6
 *
7
 * You may not change or alter any portion of this comment or credits
8
 * of supporting developers from this source code or any supporting source code
9
 * which is considered copyrighted (c) material of the original comment or credit authors.
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
 *
14
 * @copyright         Hervé Thouzard (https://www.herve-thouzard.com)
15
 * @license           GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html)
16
 * @author            Hervé Thouzard (https://www.herve-thouzard.com)
17
 *
18
 * Version :
19
 * ****************************************************************************
20
 *
21
 * @param $limit
22
 * @param $dateFormat
23
 * @param $itemsSize
24
 *
25
 * @return array
26
 */
27
28
//  ------------------------------------------------------------------------ //
29
//  TplLeagueStats plugin for Marquee 2.4                                    //
30
//  written by Defkon1 [defkon1 at gmail dot com]                            //
31
//  ------------------------------------------------------------------------ //
32
function b_marquee_tplleaguestats($limit, $dateFormat, $itemsSize)
33
{
34
    //    require_once XOOPS_ROOT_PATH . '/modules/marquee/class/Utility.php';
35
    //######################## SETTINGS ######################
36
    $displaySeason  = false; // display season name?
37
    $hour           = 1; // GMT+1  -> var = 1
38
    $useItemSize    = false; // use marquee $itemsize value?
39
    $overwriteLimit = true; // overwrite marquee's limit settings?
40
    $newLimit       = 6; // new limit (valid only if
41
    //     overwrite_limit_settings = true)
42
    $overwriteDateformat = true; // overwrite marquee's dateformat?
43
    $newDateformat       = 'd/m/Y'; // new dateformat (valid only if
44
    //     overwrite_dateformat_settings=true)
45
    //######################## SETTINGS ######################
46
    global $xoopsDB;
47
    if ($overwriteLimit) {
0 ignored issues
show
The condition $overwriteLimit is always true.
Loading history...
48
        $limit = $newLimit;
49
    }
50
    if ($overwriteDateformat) {
0 ignored issues
show
The condition $overwriteDateformat is always true.
Loading history...
51
        $dateFormat = $newDateformat;
52
    }
53
    $block  = [];
54
    $myts   = \MyTextSanitizer::getInstance();
0 ignored issues
show
The assignment to $myts is dead and can be removed.
Loading history...
55
    $sql    = 'SELECT H.OpponentName as home, A.OpponentName as away, M.LeagueMatchHomeGoals as home_p, M.LeagueMatchAwayGoals as away_p,
56
                  M.LeagueMatchDate as date, S.SeasonName as season
57
           FROM ' . $xoopsDB->prefix('tplls_leaguematches') . ' M
58
           LEFT JOIN ' . $xoopsDB->prefix('tplls_opponents') . ' AS H ON M.LeagueMatchHomeID = H.OpponentID
59
           LEFT JOIN ' . $xoopsDB->prefix('tplls_opponents') . ' AS A ON M.LeagueMatchAwayID = A.OpponentID
60
           LEFT JOIN ' . $xoopsDB->prefix('tplls_seasonnames') . " AS S ON M.LeagueMatchSeasonID = S.SeasonID
61
           ORDER BY M.LeagueMatchDate DESC
62
           LIMIT 0,$limit";
63
    $result = $xoopsDB->query($sql);
64
    if (!$xoopsDB->isResultSet($result)) {
65
        throw new \RuntimeException(
66
            \sprintf(_DB_QUERY_ERROR, $sql) . $xoopsDB->error(), E_USER_ERROR);
67
    }
68
    while (false !== ($myrow = $xoopsDB->fetchArray($result))) {
69
        $title = htmlspecialchars($myrow['home'], ENT_QUOTES | ENT_HTML5) . ' - ' . htmlspecialchars($myrow['away'], ENT_QUOTES | ENT_HTML5) . ' ' . htmlspecialchars($myrow['home_p'], ENT_QUOTES | ENT_HTML5) . '-' . htmlspecialchars($myrow['away_p'], ENT_QUOTES | ENT_HTML5);
70
        if ($useItemSize && $itemsSize > 0) {
71
            $title = xoops_substr($title, 0, $itemsSize + 3);
72
        }
73
        $arrDate = explode('-', $myrow['date']);
74
        $season  = '';
75
        if ($displaySeason) {
76
            $season = $myrow['season'];
77
        }
78
        $block[] = [
79
            'date'     => formatTimestamp(mktime($hour, 0, 0, $arrDate[1], $arrDate[2], $arrDate[0]), $dateFormat),
0 ignored issues
show
$arrDate[1] of type string is incompatible with the type integer expected by parameter $month of mktime(). ( Ignorable by Annotation )

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

79
            'date'     => formatTimestamp(mktime($hour, 0, 0, /** @scrutinizer ignore-type */ $arrDate[1], $arrDate[2], $arrDate[0]), $dateFormat),
Loading history...
$arrDate[0] of type string is incompatible with the type integer expected by parameter $year of mktime(). ( Ignorable by Annotation )

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

79
            'date'     => formatTimestamp(mktime($hour, 0, 0, $arrDate[1], $arrDate[2], /** @scrutinizer ignore-type */ $arrDate[0]), $dateFormat),
Loading history...
$arrDate[2] of type string is incompatible with the type integer expected by parameter $day of mktime(). ( Ignorable by Annotation )

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

79
            'date'     => formatTimestamp(mktime($hour, 0, 0, $arrDate[1], /** @scrutinizer ignore-type */ $arrDate[2], $arrDate[0]), $dateFormat),
Loading history...
80
            'category' => $season,
81
            'author'   => '',
82
            'title'    => $title,
83
            'link'     => '<a href="' . XOOPS_URL . '/modules/tplleaguestats">' . $title . '</a>',
84
        ];
85
    }
86
87
    return $block;
88
}
89