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.

class/Marqueex.php (18 issues)

Labels
1
<?php declare(strict_types=1);
2
3
namespace XoopsModules\Marquee;
4
5
/**
6
 * ****************************************************************************
7
 * marquee - MODULE FOR XOOPS
8
 * Copyright (c) Hervé Thouzard (https://www.herve-thouzard.com)
9
 *
10
 * You may not change or alter any portion of this comment or credits
11
 * of supporting developers from this source code or any supporting source code
12
 * which is considered copyrighted (c) material of the original comment or credit authors.
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16
 *
17
 * @copyright          Hervé Thouzard (https://www.herve-thouzard.com)
18
 * @license            GNU GPL 2.0 or later (https://www.gnu.org/licenses/gpl-2.0.html)
19
 * @author             Hervé Thouzard (https://www.herve-thouzard.com)
20
 * ****************************************************************************
21
 */
22
23
//require_once XOOPS_ROOT_PATH . '/kernel/object.php';
24
//require_once XOOPS_ROOT_PATH . '/modules/marquee/class/Utility.php';
25
//if (!class_exists('MarqueePersistableObjectHandler')) {
26
//    require_once XOOPS_ROOT_PATH . '/modules/marquee/class/PersistableObjectHandler.php';
27
//}
28
29
/**
30
 * Class Marqueex
31
 */
32
class Marqueex extends \XoopsObject
33
{
34
    private $marquee_marqueeid;
0 ignored issues
show
The private property $marquee_marqueeid is not used, and could be removed.
Loading history...
35
    private $marquee_uid;
0 ignored issues
show
The private property $marquee_uid is not used, and could be removed.
Loading history...
36
    private $marquee_direction;
0 ignored issues
show
The private property $marquee_direction is not used, and could be removed.
Loading history...
37
    private $marquee_scrollamount;
0 ignored issues
show
The private property $marquee_scrollamount is not used, and could be removed.
Loading history...
38
    private $marquee_behaviour;
0 ignored issues
show
The private property $marquee_behaviour is not used, and could be removed.
Loading history...
39
    private $marquee_bgcolor;
0 ignored issues
show
The private property $marquee_bgcolor is not used, and could be removed.
Loading history...
40
    private $marquee_align;
0 ignored issues
show
The private property $marquee_align is not used, and could be removed.
Loading history...
41
    private $marquee_height;
0 ignored issues
show
The private property $marquee_height is not used, and could be removed.
Loading history...
42
    private $marquee_width;
0 ignored issues
show
The private property $marquee_width is not used, and could be removed.
Loading history...
43
    private $marquee_hspace;
0 ignored issues
show
The private property $marquee_hspace is not used, and could be removed.
Loading history...
44
    private $marquee_scrolldelay;
0 ignored issues
show
The private property $marquee_scrolldelay is not used, and could be removed.
Loading history...
45
    private $marquee_stoponmouseover;
0 ignored issues
show
The private property $marquee_stoponmouseover is not used, and could be removed.
Loading history...
46
    private $marquee_loop;
0 ignored issues
show
The private property $marquee_loop is not used, and could be removed.
Loading history...
47
    private $marquee_vspace;
0 ignored issues
show
The private property $marquee_vspace is not used, and could be removed.
Loading history...
48
    private $marquee_content;
0 ignored issues
show
The private property $marquee_content is not used, and could be removed.
Loading history...
49
    private $marquee_source;
0 ignored issues
show
The private property $marquee_source is not used, and could be removed.
Loading history...
50
    // To be able to use html
51
    private $dohtml;
0 ignored issues
show
The private property $dohtml is not used, and could be removed.
Loading history...
52
53
    /**
54
     * marquee constructor.
55
     */
56
    public function __construct()
57
    {
58
        parent::__construct();
59
        $this->initVar('marquee_marqueeid', \XOBJ_DTYPE_INT, null, false);
60
        $this->initVar('marquee_uid', \XOBJ_DTYPE_INT, null, false);
61
        $this->initVar('marquee_direction', \XOBJ_DTYPE_INT, null, false);
62
        $this->initVar('marquee_scrollamount', \XOBJ_DTYPE_INT, null, false);
63
        $this->initVar('marquee_behaviour', \XOBJ_DTYPE_INT, null, false);
64
        $this->initVar('marquee_bgcolor', \XOBJ_DTYPE_TXTBOX, null, false, 7);
65
        $this->initVar('marquee_align', \XOBJ_DTYPE_INT, null, false);
66
        $this->initVar('marquee_height', \XOBJ_DTYPE_INT, null, false);
67
        $this->initVar('marquee_width', \XOBJ_DTYPE_TXTBOX, null, false, 4);
68
        $this->initVar('marquee_hspace', \XOBJ_DTYPE_INT, null, false);
69
        $this->initVar('marquee_scrolldelay', \XOBJ_DTYPE_INT, null, false);
70
        $this->initVar('marquee_stoponmouseover', \XOBJ_DTYPE_INT, null, false);
71
        $this->initVar('marquee_loop', \XOBJ_DTYPE_INT, null, false);
72
        $this->initVar('marquee_vspace', \XOBJ_DTYPE_INT, null, false);
73
        $this->initVar('marquee_content', \XOBJ_DTYPE_OTHER, null, false);
74
        $this->initVar('marquee_source', \XOBJ_DTYPE_TXTBOX, null, false, 255);
75
        // To be able to use html
76
        $this->initVar('dohtml', \XOBJ_DTYPE_INT, 1);
77
    }
78
79
    /**
80
     * @param string $uniqid
81
     *
82
     * @return mixed|string
83
     */
84
    public function constructMarquee($uniqid = '')
85
    {
86
        //        require_once XOOPS_ROOT_PATH . '/modules/marquee/class/Utility.php';
87
        $tblalign     = ['top', 'bottom', 'middle'];
88
        $tblbehaviour = ['scroll', 'slide', 'alternate'];
89
        $tbldirection = ['right', 'left', 'up', 'down'];
90
        $stop         = 1 == $this->getVar('marquee_stoponmouseover') ? ' onmouseover="this.stop()" onmouseout="this.start()"' : '';
91
        $bgcolor      = '' !== \trim($this->getVar('marquee_bgcolor')) ? " bgcolor='" . $this->getVar('marquee_bgcolor') . "'" : '';
92
        $height       = 0 != $this->getVar('marquee_height') ? ' height=' . $this->getVar('marquee_height') : '';
93
        $hspace       = 0 != $this->getVar('marquee_hspace') ? ' hspace=' . $this->getVar('marquee_hspace') : '';
94
        $width        = '' !== \trim($this->getVar('marquee_width')) ? " width='" . $this->getVar('marquee_width') . "'" : '';
95
        $scrolldelay  = 0 != $this->getVar('marquee_scrolldelay') ? ' scrolldelay=' . $this->getVar('marquee_scrolldelay') : '';
96
        $loop         = 0 != $this->getVar('marquee_loop') ? ' loop=' . $this->getVar('marquee_loop') : " loop='infinite'";
97
        $vspace       = 0 != $this->getVar('marquee_vspace') ? ' vspace=' . $this->getVar('marquee_vspace') : '';
98
        $scrollamount = 0 != $this->getVar('marquee_scrollamount') ? ' scrollamount=' . $this->getVar('marquee_scrollamount') : '';
99
        $br           = ' - ';
100
        if ($this->getVar('marquee_direction') > 1) {
101
            $br = '<br>';
102
        }
103
        $content = '';
104
        if ('fixed' !== $this->getVar('marquee_source')) {
105
            require_once XOOPS_ROOT_PATH . '/modules/marquee/plugins/' . $this->getVar('marquee_source') . '.php';
106
            $function_name = 'b_marquee_' . $this->getVar('marquee_source'); // For example b_marquee_comments
107
            if (\function_exists($function_name)) {
108
                $limit      = Utility::getModuleOption('itemscount');
109
                $dateFormat = Utility::getModuleOption('dateformat');
110
                $itemsSize  = Utility::getModuleOption('itemssize');
111
                $retval     = $function_name($limit, $dateFormat, $itemsSize);
112
                if ($retval && \is_array($retval)) {
113
                    foreach ($retval as $onevalue) {
114
                        if (isset($onevalue['category']) && '' !== \xoops_trim($onevalue['category'])) {
115
                            $onevalue['category'] = ' - ' . $onevalue['category'];
116
                        }
117
                        if (isset($onevalue['link']) && '' !== \xoops_trim($onevalue['link'])) {
118
                            $onevalue['link'] = ' - ' . $onevalue['link'];
119
                        }
120
                        $content .= $onevalue['date'] . $onevalue['category'] . $onevalue['link'] . $br;
121
                    }
122
                }
123
            }
124
        } else {
125
            $content = $this->getVar('marquee_content');
126
        }
127
        if (!Utility::isBot()) { // We are using the microsoft html tag
128
            if ('dhtml' !== \mb_strtolower(Utility::getModuleOption('methodtouse'))) {
0 ignored issues
show
XoopsModules\Marquee\Uti...leOption('methodtouse') of type boolean is incompatible with the type string expected by parameter $string of mb_strtolower(). ( Ignorable by Annotation )

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

128
            if ('dhtml' !== \mb_strtolower(/** @scrutinizer ignore-type */ Utility::getModuleOption('methodtouse'))) {
Loading history...
129
                return "<marquee align='"
130
                       . $tblalign[$this->getVar('marquee_align')]
131
                       . "' behavior='"
132
                       . $tblbehaviour[$this->getVar('marquee_behaviour')]
133
                       . "' direction='"
134
                       . $tbldirection[$this->getVar('marquee_direction')]
135
                       . "' "
136
                       . $stop
137
                       . $scrollamount
138
                       . $bgcolor
139
                       . $height
140
                       . $hspace
141
                       . $width
142
                       . $scrolldelay
143
                       . $loop
144
                       . $vspace
145
                       . '>'
146
                       . $content
147
                       . '</marquee>';
148
            }   // We are using the javascript method
149
            $jscontent = "<script type=\"text/javascript\">\n";
150
            $jscontent .= "html$uniqid = '';\n";
151
            $jscontent .= "html$uniqid += '" . Utility::javascriptEscape($content) . "' ;\n";
152
            $jscontent .= "marquee$uniqid = new XbMarquee('marquee$uniqid', " . $this->getVar('marquee_height') . ', ' . $this->getVar('marquee_width') . ', ' . $this->getVar('marquee_scrollamount') . ', ' . $this->getVar('marquee_scrolldelay') . ", '" . $tbldirection[$this->getVar(
153
                    'marquee_direction'
154
                )] . "', '" . $tblbehaviour[$this->getVar('marquee_behaviour')] . "', html$uniqid);\n";
155
            $jscontent .= "init_$uniqid();\n";
156
            $jscontent .= "</script>\n";
157
158
            return $jscontent;
159
        }
160
161
        return $content;
162
    }
163
}
164