Issues (267)

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.
Labels
Severity
1
<?php
2
3
/**
4
 * Module: XoopsTube
5
 *
6
 * You may not change or alter any portion of this comment or credits
7
 * of supporting developers from this source code or any supporting source code
8
 * which is considered copyrighted (c) material of the original comment or credit authors.
9
 *
10
 * PHP version 5
11
 *
12
 * @category        Module
13
 * @package         Xoopstube
14
 * @author          XOOPS Development Team
15
 * @copyright       2001-2016 XOOPS Project (https://xoops.org)
16
 * @license         GNU GPL 2 or later (https://www.gnu.org/licenses/gpl-2.0.html)
17
 * @link            https://xoops.org/
18
 * @since           1.0.6
19
 */
20
21
use Xmf\Request;
22
use XoopsModules\Xoopstube\{
23
    Common\LetterChoice,
24
    Helper,
25
    Tree,
26
    Utility,
27
    VideosHandler,
28
    Thumbnails
29
};
30
31
$GLOBALS['xoopsOption']['template_main'] = 'xoopstube_index.tpl';
32
33
require_once __DIR__ . '/header.php';
34
35
$moduleDirName      = basename(__DIR__);
36
$moduleDirNameUpper = mb_strtoupper($moduleDirName);
37
38
$start = Request::getInt('start', Request::getInt('start', 0, 'POST'), 'GET');
39
40
41
//$xoTheme->addStylesheet('modules/' . $moduleDirName . '/assets/css/xtubestyle.css');
42
43
$xoTheme->addScript(XOOPS_URL . '/browse.php?Frameworks/jquery/jquery.js');
44
$xoTheme->addStylesheet(XOOPSTUBE_URL . '/assets/css/module.css');
0 ignored issues
show
The constant XOOPSTUBE_URL was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
45
46
//$xoopsTpl->assign('mod_url', XOOPSTUBE_URL . '/');
47
48
//require_once XOOPS_ROOT_PATH . '/header.php';
49
50
$mytree    = new Tree($GLOBALS['xoopsDB']->prefix('xoopstube_cat'), 'cid', 'pid');
51
$myts = \MyTextSanitizer::getInstance(); // MyTextSanitizer object
52
53
// Begin Main page Heading etc
54
$sql      = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_indexpage');
55
$head_arr = $GLOBALS['xoopsDB']->fetchArray($GLOBALS['xoopsDB']->query($sql));
56
57
$catarray['imageheader']      = Utility::renderImageHeader($head_arr['indeximage'], $head_arr['indexheading']);
58
$catarray['indexheaderalign'] = htmlspecialchars($head_arr['indexheaderalign'], ENT_QUOTES | ENT_HTML5);
59
$catarray['indexfooteralign'] = htmlspecialchars($head_arr['indexfooteralign'], ENT_QUOTES | ENT_HTML5);
60
61
$html   = $head_arr['nohtml'] ? 0 : 1;
62
$smiley = $head_arr['nosmiley'] ? 0 : 1;
63
$xcodes = $head_arr['noxcodes'] ? 0 : 1;
64
$images = $head_arr['noimages'] ? 0 : 1;
65
$breaks = $head_arr['nobreak'] ? 1 : 0;
66
67
$catarray['indexheading'] = $myts->displayTarea($head_arr['indexheading'], $html, $smiley, $xcodes, $images, $breaks);
68
$catarray['indexheader']  = $myts->displayTarea($head_arr['indexheader'], $html, $smiley, $xcodes, $images, $breaks);
69
$catarray['indexfooter']  = $myts->displayTarea($head_arr['indexfooter'], $html, $smiley, $xcodes, $images, $breaks);
70
71
//$catarray['letters']      = Utility::getLetters();
72
73
// Letter Choice Start ---------------------------------------
74
75
Helper::getInstance()->loadLanguage('common');
76
$xoopsTpl->assign('letterChoiceTitle', constant('CO_' . $moduleDirNameUpper . '_' . 'BROWSETOTOPIC'));
77
$db             = \XoopsDatabaseFactory::getDatabaseConnection();
78
$objHandler     = new VideosHandler($db);
79
$choicebyletter = new LetterChoice($objHandler, null, null, range('a', 'z'), 'letter', 'viewcat.php');
80
//$choicebyletter = new LetterChoice($objHandler, null, null, range('a', 'z'), 'init', XOOPSTUBE_URL . '/letter.php');
81
//render the LetterChoice partial and story as part of the Category array
82
//$catarray['letters']  = $choicebyletter->render($alphaCount, $howmanyother);
83
84
$catarray['letters'] = $choicebyletter->render();
85
86
//now assign it to the Smarty variable
87
$xoopsTpl->assign('catarray', $catarray);
88
89
// Letter Choice End ------------------------------------
90
91
// End main page Headers
92
93
$count   = 1;
94
$chcount = 0;
95
$countin = 0;
96
97
// Begin Main page linkload info
98
$listings = Utility::getTotalItems();
99
// get total amount of categories
100
$total_cat = Utility::getTotalCategoryCount();
101
102
$catsort = $GLOBALS['xoopsModuleConfig']['sortcats'];
103
$sql     = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_cat') . ' WHERE pid=0 ORDER BY ' . $catsort;
104
$result  = $GLOBALS['xoopsDB']->query($sql);
105
while (false !== ($myrow = $GLOBALS['xoopsDB']->fetchArray($result))) {
106
    ++$countin;
107
    $subtotalvideoload = 0;
108
    $totalvideoload    = Utility::getTotalItems($myrow['cid'], 1);
109
    $indicator         = Utility::isNewImage($totalvideoload['published']);
110
    if (Utility::checkGroups($myrow['cid'])) {
111
        $title = htmlspecialchars($myrow['title'], ENT_QUOTES | ENT_HTML5);
112
113
        $arr = [];
114
        $arr = $mytree->getFirstChild($myrow['cid'], 'title');
115
116
        $space         = 1;
117
        $chcount       = 1;
118
        $subcategories = '';
119
        foreach ($arr as $ele) {
120
            if (true === Utility::checkGroups($ele['cid'])) {
121
                if (1 == $GLOBALS['xoopsModuleConfig']['subcats']) {
122
                    $chtitle = htmlspecialchars($ele['title'], ENT_QUOTES | ENT_HTML5);
123
                    if ($chcount > 5) {
124
                        $subcategories .= '...';
125
                        break;
126
                    }
127
                    if ($space > 0) {
128
                        $subcategories .= '<br>';
129
                    }
130
                    $subcategories .= '<a href="' . XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewcat.php?cid=' . $ele['cid'] . '">' . $chtitle . '</a>';
131
                    ++$space;
132
                    ++$chcount;
133
                }
134
            }
135
        }
136
137
        // This code is copyright WF-Projects
138
        // Using this code without our permission or removing this code voids the license agreement
139
        $_image = $myrow['imgurl'] ? urldecode($myrow['imgurl']) : '';
140
        if ('' !== $_image && $GLOBALS['xoopsModuleConfig']['usethumbs']) {
141
            $_thumb_image = new Thumbnails($_image, $GLOBALS['xoopsModuleConfig']['catimage'], 'thumbs');
142
            if ($_thumb_image) {
143
                $_thumb_image->setUseThumbs(1);
144
                $_thumb_image->setImageType('gd2');
145
                $_image = $_thumb_image->createThumbnail($GLOBALS['xoopsModuleConfig']['shotwidth'], $GLOBALS['xoopsModuleConfig']['shotheight'], $GLOBALS['xoopsModuleConfig']['imagequality'], $GLOBALS['xoopsModuleConfig']['updatethumbs'], $GLOBALS['xoopsModuleConfig']['imageAspect']);
146
            }
147
        }
148
        if (empty($_image) || '' == $_image) {
149
            $imgurl  = $indicator['image'];
150
            $_width  = 33;
151
            $_height = 24;
152
        } else {
153
            $imgurl  = "{$GLOBALS['xoopsModuleConfig']['catimage']}/$_image";
154
            $_width  = $GLOBALS['xoopsModuleConfig']['shotwidth'];
155
            $_height = $GLOBALS['xoopsModuleConfig']['shotheight'];
156
        }
157
        // End
158
159
        $xoopsTpl->append(
160
            'categories',
161
            [
162
                'image'         => XOOPS_URL . "/$imgurl",
163
                'id'            => $myrow['cid'],
164
                'title'         => $title,
165
                'subcategories' => $subcategories,
166
                'totalvideos'   => $totalvideoload['count'],
167
                'width'         => $_width,
168
                'height'        => $_height,
169
                'count'         => $count,
170
                'alttext'       => $myrow['description'],
171
            ]
172
        );
173
        ++$count;
174
    }
175
}
176
switch ($total_cat) {
177
    case '1':
178
        $lang_thereare = _MD_XOOPSTUBE_THEREIS;
179
        break;
180
    default:
181
        $lang_thereare = _MD_XOOPSTUBE_THEREARE;
182
        break;
183
}
184
185
$time = time();
186
187
$sql        = $GLOBALS['xoopsDB']->query('SELECT lastvideosyn, lastvideostotal FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_indexpage'));
188
$lastvideos = $GLOBALS['xoopsDB']->fetchArray($sql);
189
190
if (1 == $lastvideos['lastvideosyn'] && $lastvideos['lastvideostotal'] > 0) {
191
    $result = $GLOBALS['xoopsDB']->query(
192
        'SELECT COUNT(*) FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_videos') . ' WHERE published > 0
193
                                AND published <= ' . $time . '
194
                                AND (expired = 0 OR expired > ' . $time . ')
195
                                AND offline = 0
196
                                ORDER BY published DESC',
197
        0,
198
        0
199
    );
200
    [$count] = $GLOBALS['xoopsDB']->fetchRow($result);
201
202
    $count = (($count > $lastvideos['lastvideostotal']) && (0 !== $lastvideos['lastvideostotal'])) ? $lastvideos['lastvideostotal'] : $count;
203
    $limit = (($start + $GLOBALS['xoopsModuleConfig']['perpage']) > $count) ? ($count - $start) : $GLOBALS['xoopsModuleConfig']['perpage'];
204
205
    $result = $GLOBALS['xoopsDB']->query(
206
        'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_videos') . ' WHERE published > 0
207
                                AND published <= ' . time() . '
208
                                AND (expired = 0 OR expired > ' . time() . ')
209
                                AND offline = 0
210
                                ORDER BY published DESC',
211
        $limit,
212
        $start
213
    );
214
215
    while (false !== ($videoArray = $GLOBALS['xoopsDB']->fetchArray($result))) {
216
        if (true === Utility::checkGroups($videoArray['cid'])) {
217
            $res_type = 0;
218
            $moderate = 0;
219
            $cid      = $videoArray['cid'];
220
            require_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/include/videoloadinfo.php';
221
            $xoopsTpl->append('video', $video);
222
        }
223
    }
224
225
    $pagenav = new \XoopsPageNav($count, $GLOBALS['xoopsModuleConfig']['perpage'], $start, 'start');
226
    $xoopsTpl->assign('pagenav', $pagenav->renderNav());
227
    $xoopsTpl->assign('showlatest', $lastvideos['lastvideosyn']);
228
}
229
230
$xoopsTpl->assign('cat_columns', $GLOBALS['xoopsModuleConfig']['catcolumns']);
231
$xoopsTpl->assign('lang_thereare', sprintf($lang_thereare, $total_cat, $listings['count']));
232
$xoopsTpl->assign('module_dir', $xoopsModule->getVar('dirname'));
233
$xoopsTpl->assign('mod_url', XOOPSTUBE_URL . '/');
234
$xoopsTpl->assign('xoopstube_url', XOOPSTUBE_URL . '/');
235
236
require_once XOOPS_ROOT_PATH . '/footer.php';
237