mambax7 /
marquee
This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include, or for example
via PHP's auto-loading mechanism.
| 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
introduced
by
Loading history...
|
|||||
| 35 | private $marquee_uid; |
||||
|
0 ignored issues
–
show
|
|||||
| 36 | private $marquee_direction; |
||||
|
0 ignored issues
–
show
|
|||||
| 37 | private $marquee_scrollamount; |
||||
|
0 ignored issues
–
show
|
|||||
| 38 | private $marquee_behaviour; |
||||
|
0 ignored issues
–
show
|
|||||
| 39 | private $marquee_bgcolor; |
||||
|
0 ignored issues
–
show
|
|||||
| 40 | private $marquee_align; |
||||
|
0 ignored issues
–
show
|
|||||
| 41 | private $marquee_height; |
||||
|
0 ignored issues
–
show
|
|||||
| 42 | private $marquee_width; |
||||
|
0 ignored issues
–
show
|
|||||
| 43 | private $marquee_hspace; |
||||
|
0 ignored issues
–
show
|
|||||
| 44 | private $marquee_scrolldelay; |
||||
|
0 ignored issues
–
show
|
|||||
| 45 | private $marquee_stoponmouseover; |
||||
|
0 ignored issues
–
show
|
|||||
| 46 | private $marquee_loop; |
||||
|
0 ignored issues
–
show
|
|||||
| 47 | private $marquee_vspace; |
||||
|
0 ignored issues
–
show
|
|||||
| 48 | private $marquee_content; |
||||
|
0 ignored issues
–
show
|
|||||
| 49 | private $marquee_source; |
||||
|
0 ignored issues
–
show
|
|||||
| 50 | // To be able to use html |
||||
| 51 | private $dohtml; |
||||
|
0 ignored issues
–
show
|
|||||
| 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
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 |