Issues (132)

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/formimage_browse.php (15 issues)

1
<?php
2
3
namespace XoopsModules\Mastopgo2;
4
5
### =============================================================
6
### Mastop InfoDigital - Paixão por Internet
7
### =============================================================
8
### Arquivo navegação na Biblioteca de imagens
9
### =============================================================
10
### Developer: Fernando Santos (topet05), [email protected]
11
### Copyright: Mastop InfoDigital © 2003-2007
12
### -------------------------------------------------------------
13
### www.mastop.com.br
14
### =============================================================
15
###
16
### =============================================================
17
use Xmf\Request;
18
use  XoopsModules\Mastopgo2;
19
20
require_once dirname(dirname(dirname(__DIR__))) . '/include/cp_header.php';
21
22
/** @var Mastopgo2\Helper $helper */
23
$helper = Mastopgo2\Helper::getInstance();
24
25
$target = Request::getString('target');
26
require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
27
//$op = empty($_GET['op']) ? 'list' : $_GET['op'];
28
//$op = empty($_POST['op']) ? $op : $_POST['op'];
29
$op = Request::getString('op', 'list');
30
if (!is_object($xoopsUser)) {
31
    $groups = [XOOPS_GROUP_ANONYMOUS];
32
    $admin  = false;
33
} else {
34
    $groups = &$xoopsUser->getGroups();
35
    $admin  = (!$xoopsUser->isAdmin(1)) ? false : true;
36
}
37
$imgcatHandler = xoops_getHandler('imagecategory');
38
$criteriaRead  = new \CriteriaCompo();
39
if (is_array($groups) && !empty($groups)) {
40
    $criteriaTray = new \CriteriaCompo();
41
    foreach ($groups as $gid) {
42
        $criteriaTray->add(new \Criteria('gperm_groupid', $gid), 'OR');
43
    }
44
    $criteriaRead->add($criteriaTray);
45
    $criteriaRead->add(new \Criteria('gperm_name', 'imgcat_read'));
46
    $criteriaRead->add(new \Criteria('gperm_modid', 1));
47
}
48
$criteriaRead->add(new \Criteria('imgcat_display', 1));
49
$imagecategorys = $imgcatHandler->getObjects($criteriaRead);
0 ignored issues
show
The method getObjects() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of said class. However, the method does not exist in XoopsRankHandler or XoUserHandler. Are you sure you never get one of those? ( Ignorable by Annotation )

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

49
/** @scrutinizer ignore-call */ 
50
$imagecategorys = $imgcatHandler->getObjects($criteriaRead);
Loading history...
50
$criteriaWrite  = new \CriteriaCompo();
51
if (is_array($groups) && !empty($groups)) {
52
    $criteriaWrite->add($criteriaTray);
53
    $criteriaWrite->add(new \Criteria('gperm_name', 'imgcat_read'));
54
    $criteriaWrite->add(new \Criteria('gperm_modid', 1));
55
}
56
$criteriaWrite->add(new \Criteria('imgcat_display', 1));
57
$imagecategorysWrite = $imgcatHandler->getObjects($criteriaWrite);
58
59
require_once XOOPS_ROOT_PATH . '/modules/system/language/' . $xoopsConfig['language'] . '/admin/images.php';
60
if ('updatecat' === $op && $admin) {
61
    $imgcat_id  = Request::getInt('imgcat_id', 0, 'POST'); //$_POST['imgcat_id'];
62
    $readgroup  = Request::getString('readgroup', '', 'POST');
63
    $writegroup = Request::getString('writegroup', '', 'POST');
64
    if (!$GLOBALS['xoopsSecurity']->check() || $imgcat_id <= 0) {
65
        redirect_header(Request::getString('PHP_SELF', '', 'SERVER'), 1, implode('<br>', $GLOBALS['xoopsSecurity']->getErrors()));
66
    }
67
    $imgcatHandler = xoops_getHandler('imagecategory');
68
    $imagecategory = &$imgcatHandler->get($imgcat_id);
69
    if (!is_object($imagecategory)) {
70
        redirect_header(Request::getString('PHP_SELF', '', 'SERVER'), 1);
71
    }
72
    $imagecategory->setVar('imgcat_name', Request::getString('imgcat_name', '', 'POST'));
73
    $imgcat_display = Request::hasVar('imgcat_display', 'POST') ? 1 : 0; //empty($_POST['imgcat_display']) ? 0 : 1;
74
    $imagecategory->setVar('imgcat_display', Request::getInt('imgcat_display', 0, 'POST')); // $_POST['imgcat_display']);
75
    $imagecategory->setVar('imgcat_maxsize', Request::getInt('imgcat_maxsize', 0, 'POST')); //  $_POST['imgcat_maxsize']);
76
    $imagecategory->setVar('imgcat_maxwidth', Request::getInt('imgcat_maxwidth', 0, 'POST')); //  $_POST['imgcat_maxwidth']);
77
    $imagecategory->setVar('imgcat_maxheight', Request::getInt('imgcat_maxheight', 0, 'POST')); //  $_POST['imgcat_maxheight']);
78
    $imagecategory->setVar('imgcat_weight', Request::getInt('imgcat_weight', 0, 'POST')); //  $_POST['imgcat_weight']);
79
    if (!$imgcatHandler->insert($imagecategory)) {
0 ignored issues
show
Are you sure the usage of $imgcatHandler->insert($imagecategory) targeting XoopsObjectHandler::insert() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
80
        exit();
81
    }
82
    $imagecategorypermHandler = xoops_getHandler('groupperm');
83
    $criteria                 = new \CriteriaCompo(new \Criteria('gperm_itemid', $imgcat_id));
84
    $criteria->add(new \Criteria('gperm_modid', 1));
85
    $criteria2 = new \CriteriaCompo(new \Criteria('gperm_name', 'imgcat_write'));
86
    $criteria2->add(new \Criteria('gperm_name', 'imgcat_read'), 'OR');
87
    $criteria->add($criteria2);
88
    $imagecategorypermHandler->deleteAll($criteria);
0 ignored issues
show
The method deleteAll() does not exist on XoopsObjectHandler. Did you maybe mean delete()? ( Ignorable by Annotation )

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

88
    $imagecategorypermHandler->/** @scrutinizer ignore-call */ 
89
                               deleteAll($criteria);

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
89
    if (!isset($readgroup)) {
90
        $readgroup = [];
91
    }
92
    if (!in_array(XOOPS_GROUP_ADMIN, $readgroup)) {
0 ignored issues
show
It seems like $readgroup can also be of type string; however, parameter $haystack of in_array() does only seem to accept array, maybe add an additional type check? ( Ignorable by Annotation )

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

92
    if (!in_array(XOOPS_GROUP_ADMIN, /** @scrutinizer ignore-type */ $readgroup)) {
Loading history...
93
        $readgroup[] = XOOPS_GROUP_ADMIN;
94
    }
95
    foreach ($readgroup as $rgroup) {
96
        $imagecategoryperm = $imagecategorypermHandler->create();
97
        $imagecategoryperm->setVar('gperm_groupid', $rgroup);
98
        $imagecategoryperm->setVar('gperm_itemid', $imgcat_id);
99
        $imagecategoryperm->setVar('gperm_name', 'imgcat_read');
100
        $imagecategoryperm->setVar('gperm_modid', 1);
101
        $imagecategorypermHandler->insert($imagecategoryperm);
102
        unset($imagecategoryperm);
103
    }
104
    if (!isset($writegroup)) {
105
        $writegroup = [];
106
    }
107
    if (!in_array(XOOPS_GROUP_ADMIN, $writegroup)) {
108
        $writegroup[] = XOOPS_GROUP_ADMIN;
109
    }
110
    foreach ($writegroup as $wgroup) {
111
        $imagecategoryperm = $imagecategorypermHandler->create();
112
        $imagecategoryperm->setVar('gperm_groupid', $wgroup);
113
        $imagecategoryperm->setVar('gperm_itemid', $imgcat_id);
114
        $imagecategoryperm->setVar('gperm_name', 'imgcat_write');
115
        $imagecategoryperm->setVar('gperm_modid', 1);
116
        $imagecategorypermHandler->insert($imagecategoryperm);
117
        unset($imagecategoryperm);
118
    }
119
    $op = 'list';
120
}
121
if ('addcat' === $op && $admin) {
122
    if (!$GLOBALS['xoopsSecurity']->check()) {
123
        redirect_header(Request::getString('PHP_SELF', '', 'SERVER'), 2, implode('<br>', $GLOBALS['xoopsSecurity']->getErrors()));
124
    }
125
126
    $readgroup     = Request::getString('readgroup', '', 'POST');
127
    $writegroup    = Request::getString('writegroup', '', 'POST');
128
    $imgcatHandler = xoops_getHandler('imagecategory');
129
    $imagecategory = $imgcatHandler->create();
130
    $imagecategory->setVar('imgcat_name', Request::getString('imgcat_name', '', 'POST')); //$_POST['imgcat_name']
131
    $imagecategory->setVar('imgcat_maxsize', Request::getInt('imgcat_maxsize', 0, 'POST')); //  $_POST['imgcat_maxsize']);
132
    $imagecategory->setVar('imgcat_maxwidth', Request::getInt('imgcat_maxwidth', 0, 'POST')); //  $_POST['imgcat_maxwidth']);
133
    $imagecategory->setVar('imgcat_maxheight', Request::getInt('imgcat_maxheight', 0, 'POST')); //  $_POST['imgcat_maxheight']);
134
    $imgcat_display = Request::hasVar('imgcat_display', 'POST') ? 1 : 0; //empty($_POST['imgcat_display']) ? 0 : 1;
135
    $imagecategory->setVar('imgcat_display', Request::getInt('imgcat_display', 0, 'POST')); // $_POST['imgcat_display']);
136
    $imagecategory->setVar('imgcat_weight', Request::getInt('imgcat_weight', 0, 'POST')); //  $_POST['imgcat_weight']);
137
    $imagecategory->setVar('imgcat_storetype', Request::getString('imgcat_storetype', '', 'POST')); //  $_POST['imgcat_storetype']);
138
139
    $imagecategory->setVar('imgcat_type', 'C');
140
    if (!$imgcatHandler->insert($imagecategory)) {
0 ignored issues
show
Are you sure the usage of $imgcatHandler->insert($imagecategory) targeting XoopsObjectHandler::insert() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
141
        exit();
142
    }
143
    $newid                    = $imagecategory->getVar('imgcat_id');
144
    $imagecategorypermHandler = xoops_getHandler('groupperm');
145
    if (!isset($readgroup)) {
146
        $readgroup = [];
147
    }
148
    if (!in_array(XOOPS_GROUP_ADMIN, $readgroup)) {
149
        $readgroup[] = XOOPS_GROUP_ADMIN;
150
    }
151
    foreach ($readgroup as $rgroup) {
152
        $imagecategoryperm = $imagecategorypermHandler->create();
153
        $imagecategoryperm->setVar('gperm_groupid', $rgroup);
154
        $imagecategoryperm->setVar('gperm_itemid', $newid);
155
        $imagecategoryperm->setVar('gperm_name', 'imgcat_read');
156
        $imagecategoryperm->setVar('gperm_modid', 1);
157
        $imagecategorypermHandler->insert($imagecategoryperm);
158
        unset($imagecategoryperm);
159
    }
160
    if (!isset($writegroup)) {
161
        $writegroup = [];
162
    }
163
    if (!in_array(XOOPS_GROUP_ADMIN, $writegroup)) {
164
        $writegroup[] = XOOPS_GROUP_ADMIN;
165
    }
166
    foreach ($writegroup as $wgroup) {
167
        $imagecategoryperm = $imagecategorypermHandler->create();
168
        $imagecategoryperm->setVar('gperm_groupid', $wgroup);
169
        $imagecategoryperm->setVar('gperm_itemid', $newid);
170
        $imagecategoryperm->setVar('gperm_name', 'imgcat_write');
171
        $imagecategoryperm->setVar('gperm_modid', 1);
172
        $imagecategorypermHandler->insert($imagecategoryperm);
173
        unset($imagecategoryperm);
174
    }
175
    $op = 'list';
176
}
177
if ('delcatok' === $op && $admin) {
178
    if (!$GLOBALS['xoopsSecurity']->check()) {
179
        redirect_header(Request::getString('PHP_SELF', '', 'SERVER') . '?target=' . $target, 3, implode('<br>', $GLOBALS['xoopsSecurity']->getErrors()));
180
    }
181
    $imgcat_id = Request::getInt('imgcat_id', 0, 'POST'); //(int)$_POST['imgcat_id'];
182
    if ($imgcat_id <= 0) {
183
        redirect_header(Request::getString('PHP_SELF', '', 'SERVER'), 1);
184
    }
185
    $imgcatHandler = xoops_getHandler('imagecategory');
186
    $imagecategory = &$imgcatHandler->get($imgcat_id);
187
    if (!is_object($imagecategory)) {
188
        redirect_header(Request::getString('PHP_SELF', '', 'SERVER'), 1);
189
    }
190
    $imageHandler = xoops_getHandler('image');
191
    $images       = $imageHandler->getObjects(new \Criteria('imgcat_id', $imgcat_id), true, false);
192
    $errors       = [];
193
    foreach (array_keys($images) as $i) {
194
        $imageHandler->delete($images[$i]);
195
        if (file_exists(XOOPS_UPLOAD_PATH . '/' . $images[$i]->getVar('image_name'))) {
196
            @unlink(XOOPS_UPLOAD_PATH . '/' . $images[$i]->getVar('image_name'));
0 ignored issues
show
Security Best Practice introduced by
It seems like you do not handle an error condition for unlink(). This can introduce security issues, and is generally not recommended. ( Ignorable by Annotation )

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

196
            /** @scrutinizer ignore-unhandled */ @unlink(XOOPS_UPLOAD_PATH . '/' . $images[$i]->getVar('image_name'));

If you suppress an error, we recommend checking for the error condition explicitly:

// For example instead of
@mkdir($dir);

// Better use
if (@mkdir($dir) === false) {
    throw new \RuntimeException('The directory '.$dir.' could not be created.');
}
Loading history...
197
        }
198
    }
199
    $imgcatHandler->delete($imagecategory);
200
    $op = 'list';
201
}
202
?>
203
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
204
<html xmlns="http://www.w3.org/1999/xhtml">
205
<head>
206
    <title><?php echo _MD_IMGMAIN ?></title>
207
    <script language="javascript" type="text/javascript">
208
        function tabberObj(argsObj) {
209
            var arg;
210
            this.div = null;
211
            this.classMain = "tabber";
212
            this.classMainLive = "tabberlive";
213
            this.classTab = "tabbertab";
214
            this.classTabDefault = "tabbertabdefault";
215
            this.classNav = "tabbernav";
216
            this.classTabHide = "tabbertabhide";
217
            this.classNavActive = "tabberactive";
218
            this.titleElements = ['h2', 'h3', 'h4', 'h5', 'h6'];
219
            this.titleElementsStripHTML = true;
220
            this.removeTitle = true;
221
            this.addLinkId = false;
222
            this.linkIdFormat = '<tabberid>nav<tabnumberone>';
223
            for (arg in argsObj) {
224
                this[arg] = argsObj[arg];
225
            }
226
            this.REclassMain = new RegExp('\\b' + this.classMain + '\\b', 'gi');
227
            this.REclassMainLive = new RegExp('\\b' + this.classMainLive + '\\b', 'gi');
228
            this.REclassTab = new RegExp('\\b' + this.classTab + '\\b', 'gi');
229
            this.REclassTabDefault = new RegExp('\\b' + this.classTabDefault + '\\b', 'gi');
230
            this.REclassTabHide = new RegExp('\\b' + this.classTabHide + '\\b', 'gi');
231
            this.tabs = new Array();
232
            if (this.div) {
233
                this.init(this.div);
234
                this.div = null;
235
            }
236
        }
237
238
        tabberObj.prototype.init = function (e) {
239
            var
240
                childNodes, i, i2, t, defaultTab = 0, DOM_ul, DOM_li, DOM_a, aId, headingElement;
241
            if (!document.getElementsByTagName) {
242
                return false;
243
            }
244
            if (e.id) {
245
                this.id = e.id;
246
            }
247
            this.tabs.length = 0;
248
            childNodes = e.childNodes;
249
            for (i = 0; i < childNodes.length; i++) {
250
                if (childNodes[i].className && childNodes[i].className.match(this.REclassTab)) {
251
                    t = new Object();
252
                    t.div = childNodes[i];
253
                    this.tabs[this.tabs.length] = t;
254
                    if (childNodes[i].className.match(this.REclassTabDefault)) {
255
                        defaultTab = this.tabs.length - 1;
256
                    }
257
                }
258
            }
259
            DOM_ul = document.createElement("ul");
260
            DOM_ul.className = this.classNav;
261
            for (i = 0; i < this.tabs.length; i++) {
262
                t = this.tabs[i];
263
                t.headingText = t.div.title;
264
                if (this.removeTitle) {
265
                    t.div.title = '';
266
                }
267
                if (!t.headingText) {
268
                    for (i2 = 0; i2 < this.titleElements.length; i2++) {
269
                        headingElement = t.div.getElementsByTagName(this.titleElements[i2])[0];
270
                        if (headingElement) {
271
                            t.headingText = headingElement.innerHTML;
272
                            if (this.titleElementsStripHTML) {
273
                                t.headingText.replace(/<br>/gi, " ");
274
                                t.headingText = t.headingText.replace(/<[^>]+>/g, "");
275
                            }
276
                            break;
277
                        }
278
                    }
279
                }
280
                if (!t.headingText) {
281
                    t.headingText = i + 1;
282
                }
283
                DOM_li = document.createElement("li");
284
                t.li = DOM_li;
285
                DOM_a = document.createElement("a");
286
                DOM_a.appendChild(document.createTextNode(t.headingText));
287
                DOM_a.href = "javascript:void(null);";
288
                DOM_a.title = t.headingText;
289
                DOM_a.onclick = this.navClick;
290
                DOM_a.tabber = this;
291
                DOM_a.tabberIndex = i;
292
                if (this.addLinkId && this.linkIdFormat) {
293
                    aId = this.linkIdFormat;
294
                    aId = aId.replace(/<tabberid>/gi, this.id);
295
                    aId = aId.replace(/<tabnumberzero>/gi, i);
296
                    aId = aId.replace(/<tabnumberone>/gi, i + 1);
297
                    aId = aId.replace(/<tabtitle>/gi, t.headingText.replace(/[^a-zA-Z0-9\-]/gi, ''));
298
                    DOM_a.id = aId;
299
                }
300
                DOM_li.appendChild(DOM_a);
301
                DOM_ul.appendChild(DOM_li);
302
            }
303
            e.insertBefore(DOM_ul, e.firstChild);
304
            e.className = e.className.replace(this.REclassMain, this.classMainLive);
305
            this.tabShow(defaultTab);
306
            if (typeof this.onLoad == 'function') {
307
                this.onLoad({tabber: this});
308
            }
309
            return this;
310
        };
311
        tabberObj.prototype.navClick = function (event) {
312
            var
313
                rVal, a, self, tabberIndex, onClickArgs;
314
            a = this;
315
            if (!a.tabber) {
316
                return false;
317
            }
318
            self = a.tabber;
319
            tabberIndex = a.tabberIndex;
320
            a.blur();
321
            if (typeof self.onClick == 'function') {
322
                onClickArgs = {'tabber': self, 'index': tabberIndex, 'event': event};
323
                if (!event) {
324
                    onClickArgs.event = window.event;
325
                }
326
                rVal = self.onClick(onClickArgs);
327
                if (rVal === false) {
328
                    return false;
329
                }
330
            }
331
            self.tabShow(tabberIndex);
332
            return false;
333
        };
334
        tabberObj.prototype.tabHideAll = function () {
335
            var i;
336
            for (i = 0; i < this.tabs.length; i++) {
337
                this.tabHide(i);
338
            }
339
        };
340
        tabberObj.prototype.tabHide = function (tabberIndex) {
341
            var div;
342
            if (!this.tabs[tabberIndex]) {
343
                return false;
344
            }
345
            div = this.tabs[tabberIndex].div;
346
            if (!div.className.match(this.REclassTabHide)) {
347
                div.className += ' ' + this.classTabHide;
348
            }
349
            this.navClearActive(tabberIndex);
350
            return this;
351
        };
352
        tabberObj.prototype.tabShow = function (tabberIndex) {
353
            var div;
354
            if (!this.tabs[tabberIndex]) {
355
                return false;
356
            }
357
            this.tabHideAll();
358
            div = this.tabs[tabberIndex].div;
359
            div.className = div.className.replace(this.REclassTabHide, '');
360
            this.navSetActive(tabberIndex);
361
            if (typeof this.onTabDisplay == 'function') {
362
                this.onTabDisplay({'tabber': this, 'index': tabberIndex});
363
            }
364
            return this;
365
        };
366
        tabberObj.prototype.navSetActive = function (tabberIndex) {
367
            this.tabs[tabberIndex].li.className = this.classNavActive;
368
            return this;
369
        };
370
        tabberObj.prototype.navClearActive = function (tabberIndex) {
371
            this.tabs[tabberIndex].li.className = '';
372
            return this;
373
        };
374
375
        function tabberAutomatic(tabberArgs) {
376
            var
377
                tempObj, divs, i;
378
            if (!tabberArgs) {
379
                tabberArgs = {};
380
            }
381
            tempObj = new tabberObj(tabberArgs);
382
            divs = document.getElementsByTagName("div");
383
            for (i = 0; i < divs.length; i++) {
384
                if (divs[i].className && divs[i].className.match(tempObj.REclassMain)) {
385
                    tabberArgs.div = divs[i];
386
                    divs[i].tabber = new tabberObj(tabberArgs);
387
                }
388
            }
389
            return this;
390
        }
391
392
        function tabberAutomaticOnLoad(tabberArgs) {
393
            var oldOnLoad;
394
            if (!tabberArgs) {
395
                tabberArgs = {};
396
            }
397
            oldOnLoad = window.onload;
398
            if (typeof window.onload != 'function') {
399
                window.onload = function () {
400
                    tabberAutomatic(tabberArgs);
401
                };
402
            } else {
403
                window.onload = function () {
404
                    oldOnLoad();
405
                    tabberAutomatic(tabberArgs);
406
                };
407
            }
408
        }
409
410
        if (typeof tabberOptions == 'undefined') {
411
            tabberAutomaticOnLoad();
412
        } else {
413
            if (!tabberOptions['manualStartup']) {
414
                tabberAutomaticOnLoad(tabberOptions);
415
            }
416
        }
417
    </script>
418
    <script language="javascript" type="text/javascript">
419
        <!--
420
        function addItem(itemurl, name, target, cat) {
421
            var win = opener;
422
            var campo = win.document.getElementById(target);
423
            var opcoes = win.document.getElementById('img_cat_' + cat);
424
            var imagem = win.document.getElementById(target + '_img');
425
            if (opcoes) {
426
                for (x = 0; x < campo.options.length; x++) {
427
                    if (campo.options[x].value == itemurl) {
428
                        campo.options[x].selected = true;
429
                        imagem.src = "<?php echo XOOPS_URL?>" + itemurl;
430
                        var found = true;
431
                    }
432
                }
433
                if (!found) {
434
                    var newOption = win.document.createElement("option");
435
                    opcoes.appendChild(newOption);
436
                    newOption.text = name;
437
                    newOption.value = itemurl;
438
                    newOption.selected = true;
439
                    imagem.src = "<?php echo XOOPS_URL?>" + itemurl;
440
                }
441
            }
442
            window.close();
443
444
            return;
445
        }
446
447
        //-->
448
    </script>
449
    <link rel="stylesheet" type="text/css" media="screen" href="<?php echo XOOPS_URL ?>/xoops.css">
450
    <link rel="stylesheet" type="text/css" media="all" href="<?php echo getcss($xoopsConfig['theme_set']) ?>">
451
    <style type="text/css">
452
        .tabberlive .tabbertabhide {
453
            display: none;
454
        }
455
456
        .tabber {
457
        }
458
459
        .tabberlive {
460
            margin-top: 1em;
461
        }
462
463
        ul.tabbernav {
464
            margin: 0;
465
            padding: 3px 0;
466
            border-bottom: 1px solid #778;
467
            font: bold 12px Verdana, sans-serif;
468
        }
469
470
        ul.tabbernav li {
471
            list-style: none;
472
            margin: 0;
473
            display: inline;
474
        }
475
476
        ul.tabbernav li a {
477
            padding: 3px 0.5em;
478
            margin-left: 3px;
479
            border: 1px solid #778;
480
            border-bottom: none;
481
            background: #DDE;
482
            text-decoration: none;
483
        }
484
485
        ul.tabbernav li a:link {
486
            color: #448;
487
        }
488
489
        ul.tabbernav li a:visited {
490
            color: #667;
491
        }
492
493
        ul.tabbernav li a:hover {
494
            color: #000;
495
            background: #AAE;
496
            border-color: #227;
497
        }
498
499
        ul.tabbernav li.tabberactive a {
500
            background-color: #fff;
501
            border-bottom: 1px solid #fff;
502
        }
503
504
        ul.tabbernav li.tabberactive a:hover {
505
            color: #000;
506
            background: #ffffff;
507
            border-bottom: 1px solid #ffffff;
508
        }
509
510
        .tabberlive .tabbertab {
511
            padding: 5px;
512
            border: 1px solid #aaa;
513
            border-top: 0;
514
515
            /* If you don't want the tab size changing whenever a tab is changed
516
               you can set a fixed height */
517
518
            height: 400px;
519
520
            /* If you set a fix height set overflow to auto and you will get a
521
               scrollbar when necessary */
522
523
            overflow: auto;
524
        }
525
526
        /* If desired, hide the heading since a heading is provided by the tab */
527
        .tabberlive .tabbertab h2 {
528
            display: none;
529
        }
530
531
        .tabberlive .tabbertab h3 {
532
            display: none;
533
        }
534
    </style>
535
</head>
536
<body>
537
<div class="tabber">
538
    <div class="tabbertab<?php echo ('listimg' === $op || 'editcat' === $op || 'delcat' === $op
539
                                     || 'list' === $op) ? ' tabbertabdefault' : ''; ?>">
540
        <h2><?php echo _SEARCH ?></h2>
541
        <?php
542
        if ('delcat' === $op && $admin) {
543
            xoops_confirm(['op' => 'delcatok', 'target' => $target, 'imgcat_id' => Request::getInt('imgcat_id', 0, 'GET')], Request::getString('PHP_SELF', '', 'SERVER'), _MD_RUDELIMGCAT);
0 ignored issues
show
The constant XoopsModules\Mastopgo2\_MD_RUDELIMGCAT was not found. Maybe you did not declare it correctly or list all dependencies?
Loading history...
544
        } elseif ('editcat' === $op && $admin) {
545
            $imgcat_id = Request::getInt('imgcat_id', 0, 'GET');
546
            if ($imgcat_id <= 0) {
547
                redirect_header(Request::getString('PHP_SELF', '', 'SERVER'), 1);
548
            }
549
            $imgcatHandler = xoops_getHandler('imagecategory');
550
            $imagecategory = &$imgcatHandler->get($imgcat_id);
551
            if (!is_object($imagecategory)) {
552
                redirect_header(Request::getString('PHP_SELF', '', 'SERVER'), 1);
553
            }
554
            $imagecategorypermHandler = xoops_getHandler('groupperm');
555
            $form                     = new \XoopsThemeForm(_MD_EDITIMGCAT, 'imagecat_form', Request::getString('PHP_SELF', '', 'SERVER'), 'post', true);
556
            $form->addElement(new \XoopsFormText(_MD_IMGCATNAME, 'imgcat_name', 50, 255, $imagecategory->getVar('imgcat_name')), true);
0 ignored issues
show
It seems like $imagecategory->getVar('imgcat_name') can also be of type array and array; however, parameter $value of XoopsFormText::__construct() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

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

556
            $form->addElement(new \XoopsFormText(_MD_IMGCATNAME, 'imgcat_name', 50, 255, /** @scrutinizer ignore-type */ $imagecategory->getVar('imgcat_name')), true);
Loading history...
557
            $form->addElement(new \XoopsFormSelectGroup(_MD_IMGCATRGRP, 'readgroup', true, $imagecategorypermHandler->getGroupIds('imgcat_read', $imgcat_id), 5, true));
0 ignored issues
show
The method getGroupIds() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of XoopsObjectHandler such as XoopsGroupPermHandler or XoopsPersistableObjectHandler. ( Ignorable by Annotation )

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

557
            $form->addElement(new \XoopsFormSelectGroup(_MD_IMGCATRGRP, 'readgroup', true, $imagecategorypermHandler->/** @scrutinizer ignore-call */ getGroupIds('imgcat_read', $imgcat_id), 5, true));
Loading history...
558
            $form->addElement(new \XoopsFormSelectGroup(_MD_IMGCATWGRP, 'writegroup', true, $imagecategorypermHandler->getGroupIds('imgcat_write', $imgcat_id), 5, true));
559
            $form->addElement(new \XoopsFormText(_IMGMAXSIZE, 'imgcat_maxsize', 10, 10, $imagecategory->getVar('imgcat_maxsize')));
560
            $form->addElement(new \XoopsFormText(_IMGMAXWIDTH, 'imgcat_maxwidth', 3, 4, $imagecategory->getVar('imgcat_maxwidth')));
561
            $form->addElement(new \XoopsFormText(_IMGMAXHEIGHT, 'imgcat_maxheight', 3, 4, $imagecategory->getVar('imgcat_maxheight')));
562
            $form->addElement(new \XoopsFormText(_MD_IMGCATWEIGHT, 'imgcat_weight', 3, 4, $imagecategory->getVar('imgcat_weight')));
563
            $form->addElement(new \XoopsFormRadioYN(_MD_IMGCATDISPLAY, 'imgcat_display', $imagecategory->getVar('imgcat_display'), _YES, _NO));
0 ignored issues
show
It seems like $imagecategory->getVar('imgcat_display') can also be of type array and array; however, parameter $value of XoopsFormRadioYN::__construct() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

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

563
            $form->addElement(new \XoopsFormRadioYN(_MD_IMGCATDISPLAY, 'imgcat_display', /** @scrutinizer ignore-type */ $imagecategory->getVar('imgcat_display'), _YES, _NO));
Loading history...
564
            $storetype = ['db' => _MD_INDB, 'file' => _MD_ASFILE];
565
            $form->addElement(new \XoopsFormLabel(_MD_IMGCATSTRTYPE, $storetype[$imagecategory->getVar('imgcat_storetype')]));
566
            $form->addElement(new \XoopsFormHidden('imgcat_id', $imgcat_id));
567
            $form->addElement(new \XoopsFormHidden('op', 'updatecat'));
568
            $form->addElement(new \XoopsFormHidden('target', $target));
569
            $form->addElement(new \XoopsFormButton('', 'imgcat_button', _SUBMIT, 'submit'));
570
            echo '<a href="' . Request::getString('PHP_SELF', '', 'SERVER') . '?target=' . $target . '">' . _MD_IMGMAIN . '</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;' . $imagecategory->getVar('imgcat_name') . '<br><br>';
571
            $form->display();
572
        } elseif ('listimg' === $op) {
573
            $imgcat_id     = Request::getInt('imgcat_id', 0, 'GET');
574
            $imgcatHandler = xoops_getHandler('imagecategory');
575
            $imagecategory = $imgcatHandler->get($imgcat_id);
576
            if (!is_object($imagecategory)) {
577
                redirect_header(Request::getString('PHP_SELF', '', 'SERVER'), 1);
578
            }
579
            $imageHandler = xoops_getHandler('image');
580
            echo '<h4><a href="' . Request::getString('PHP_SELF', '', 'SERVER') . '?target=' . $target . '">' . _MD_IMGMAIN . '</a>&nbsp;<span style="font-weight:bold;">&raquo;&raquo;</span>&nbsp;' . $imagecategory->getVar('imgcat_name') . '</h4><br><br>';
581
            $criteria = new \Criteria('imgcat_id', $imgcat_id);
582
            $imgcount = $imageHandler->getCount($criteria);
0 ignored issues
show
The method getCount() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of said class. However, the method does not exist in XoopsGroupHandler or XoopsConfigCategoryHandler or XoopsRankHandler or XoopsConfigOptionHandler or XoopsBlockHandler or XoopsImagesetHandler. Are you sure you never get one of those? ( Ignorable by Annotation )

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

582
            /** @scrutinizer ignore-call */ 
583
            $imgcount = $imageHandler->getCount($criteria);
Loading history...
583
            $start    = Request::getInt('start', 0, 'GET');
584
            $criteria->setStart($start);
585
            $criteria->setLimit(20);
586
            $images = $imageHandler->getObjects($criteria, true, false);
587
            echo '<table style="width:100%;"><thead><tr>
588
    <td>&nbsp;</td>
589
    <td style="border: 1px double #000000; text-align: center;">' . _IMAGENAME . '</td>
590
    <td style="border: 1px double #000000; text-align: center;">' . _IMAGEMIME . '</td>
591
    <td style="border: 1px double #000000; text-align: center;">' . _OPTIONS . '</td>
592
    </tr></thead><tbody>
593
    ';
594
            foreach (array_keys($images) as $i) {
595
                echo '<tr><td width="30%" style="text-align: center;">';
596
                if ('db' === $imagecategory->getVar('imgcat_storetype')) {
597
                    $imagem_url = XOOPS_URL . '/image.php?id=' . $i;
598
                    $url        = '/image.php?id=' . $i;
599
                } else {
600
                    $imagem_url = XOOPS_UPLOAD_URL . '/' . $images[$i]->getVar('image_name');
601
                    $url        = '/uploads/' . $images[$i]->getVar('image_name');
602
                }
603
                echo '<img src="'
604
                     . $imagem_url
605
                     . '" alt="" width="50" onmouseover="this.style.border=\'2px solid black\'"  onmouseout="this.style.border=\'2px solid white\'" style="border:2px solid white" onclick="addItem(\''
606
                     . $url
607
                     . '\', \''
608
                     . $images[$i]->getVar('image_nicename')
609
                     . '\', \''
610
                     . $target
611
                     . '\', \''
612
                     . $images[$i]->getVar('imgcat_id')
613
                     . '\')">';
614
                echo '</td><td style="border: 2px double #F0F0EE; text-align: center;">' . $images[$i]->getVar('image_nicename') . '</td><td style="border: 2px double #F0F0EE; text-align: center;">' . $images[$i]->getVar('image_mimetype') . '</td>';
615
                echo '<td style="border: 2px double #F0F0EE; text-align: center;"><a href="javascript:void(0)" onclick="addItem(\'' . $url . '\', \'' . $images[$i]->getVar('image_nicename') . '\', \'' . $target . '\', \'' . $images[$i]->getVar('imgcat_id') . '\')">' . _SELECT . '</a></td></tr>';
616
            }
617
            echo '</tbody></table>';
618
            if ($imgcount > 0) {
619
                if ($imgcount > 20) {
620
                    require_once XOOPS_ROOT_PATH . '/class/pagenav.php';
621
                    $nav = new \XoopsPageNav($imgcount, 20, $start, 'start', 'op=listimg&amp;imgcat_id=' . $imgcat_id);
622
                    echo '<div style="text-align:right;">' . $nav->renderNav() . '</div>';
623
                }
624
            }
625
        } else {
626
            echo '<ul>';
627
            $catcount     = count($imagecategorys);
628
            $imageHandler = xoops_getHandler('image');
629
            for ($i = 0; $i < $catcount; ++$i) {
630
                $count = $imageHandler->getCount(new \Criteria('imgcat_id', $imagecategorys[$i]->getVar('imgcat_id')));
631
                echo '<li>'
632
                     . $imagecategorys[$i]->getVar('imgcat_name')
633
                     . ' ('
634
                     . sprintf(_NUMIMAGES, '<b>' . $count . '</b>')
635
                     . ') [<a href="'
636
                     . Request::getString('PHP_SELF', '', 'SERVER')
637
                     . '?op=listimg&amp;imgcat_id='
638
                     . $imagecategorys[$i]->getVar('imgcat_id')
639
                     . '&amp;target='
640
                     . $target
641
                     . '">'
642
                     . _LIST
643
                     . '</a>]'
644
                     . ($admin ? ' [<a href="' . Request::getString('PHP_SELF', '', 'SERVER') . '?op=editcat&amp;imgcat_id=' . $imagecategorys[$i]->getVar('imgcat_id') . '&amp;target=' . $target . '">' . _EDIT . '</a>]' : '');
645
                if ('C' === $imagecategorys[$i]->getVar('imgcat_type') && $admin) {
646
                    echo ' [<a href="' . Request::getString('PHP_SELF', '', 'SERVER') . '?op=delcat&amp;imgcat_id=' . $imagecategorys[$i]->getVar('imgcat_id') . '">' . _DELETE . '</a>]';
647
                }
648
                echo '</li>';
649
            }
650
            echo '</ul>';
651
        }
652
        ?>
653
    </div>
654
    <?php
655
    if (count($imagecategorysWrite) > 0) {
656
        ?>
657
        <div class="tabbertab<?php echo ('addfile' === $op) ? ' tabbertabdefault' : ''; ?>">
658
            <h2><?php echo _ADDIMAGE ?></h2>
659
            <?php
660
            if ('addfile' === $op) {
661
                if (!$GLOBALS['xoopsSecurity']->check()) {
662
                    redirect_header(Request::getString('PHP_SELF', '', 'SERVER'), 3, implode('<br>', $GLOBALS['xoopsSecurity']->getErrors()));
663
                }
664
                $imgcatHandler = xoops_getHandler('imagecategory');
665
                $imagecategory = $imgcatHandler->get(Request::getInt('imgcat_id', 0, 'POST'));
666
                if (!is_object($imagecategory)) {
667
                    redirect_header(Request::getString('PHP_SELF', '', 'SERVER'), 1);
668
                }
669
                require_once XOOPS_ROOT_PATH . '/class/uploader.php';
670
                $uploader = new \XoopsMediaUploader(XOOPS_UPLOAD_PATH, [
671
                    'image/gif',
672
                    'image/jpeg',
673
                    'image/pjpeg',
674
                    'image/x-png',
675
                    'image/png',
676
                    'image/bmp',
677
                ], $imagecategory->getVar('imgcat_maxsize'), $imagecategory->getVar('imgcat_maxwidth'), $imagecategory->getVar('imgcat_maxheight'));
678
                $uploader->setPrefix('img');
679
                $err    = [];
680
                $ucount = count(Request::getArray('xoops_upload_file', [], 'POST'));
681
                foreach (Request::getArray('xoops_upload_file', [], 'POST') as $i => $iValue) {
682
                    if ($uploader->fetchMedia(Request::getArray('xoops_upload_file', [], 'POST')[$i])) {
683
                        if (!$uploader->upload()) {
684
                            $err[] = $uploader->getErrors();
685
                        } else {
686
                            $imageHandler = xoops_getHandler('image');
687
                            $image        = $imageHandler->create();
688
                            $image->setVar('image_name', $uploader->getSavedFileName());
689
690
                            $image->setVar('image_nicename', Request::getString('image_nicename', '', 'POST')); // $_POST['image_nicename']);
691
                            $image->setVar('image_mimetype', $uploader->getMediaType());
692
                            $image->setVar('image_created', time());
693
                            $image_display = Request::hasVar('image_display', 'POST') ? 1 : 0; //empty($_POST['image_display']) ? 0 : 1;
694
                            $image->setVar('image_display', Request::getInt('image_display', 0, 'POST')); //$_POST['image_display']);
695
                            $image->setVar('image_weight', Request::getInt('image_weight', 0, 'POST')); //$_POST['image_weight']);
696
                            $image->setVar('imgcat_id', Request::getInt('imgcat_id', 0, 'POST')); //$_POST['imgcat_id']);
697
                        }
698
                        if ('db' === $imagecategory->getVar('imgcat_storetype')) {
699
                            $fp      = @fopen($uploader->getSavedDestination(), 'rb');
700
                            $fbinary = @fread($fp, filesize($uploader->getSavedDestination()));
0 ignored issues
show
It seems like $fp can also be of type false; however, parameter $handle of fread() does only seem to accept resource, maybe add an additional type check? ( Ignorable by Annotation )

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

700
                            $fbinary = @fread(/** @scrutinizer ignore-type */ $fp, filesize($uploader->getSavedDestination()));
Loading history...
701
                            @fclose($fp);
0 ignored issues
show
It seems like $fp can also be of type false; however, parameter $handle of fclose() does only seem to accept resource, maybe add an additional type check? ( Ignorable by Annotation )

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

701
                            @fclose(/** @scrutinizer ignore-type */ $fp);
Loading history...
Security Best Practice introduced by
It seems like you do not handle an error condition for fclose(). This can introduce security issues, and is generally not recommended. ( Ignorable by Annotation )

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

701
                            /** @scrutinizer ignore-unhandled */ @fclose($fp);

If you suppress an error, we recommend checking for the error condition explicitly:

// For example instead of
@mkdir($dir);

// Better use
if (@mkdir($dir) === false) {
    throw new \RuntimeException('The directory '.$dir.' could not be created.');
}
Loading history...
702
                            $image->setVar('image_body', $fbinary, true);
703
                            @unlink($uploader->getSavedDestination());
704
                        }
705
                        if (!$imageHandler->insert($image)) {
706
                            $err[] = sprintf(_FAILSAVEIMG, $image->getVar('image_nicename'));
707
                        }
708
                    } else {
709
                        $err[] = sprintf(_FAILFETCHIMG, $i);
710
                        $err   = array_merge($err, $uploader->getErrors(false));
711
                    }
712
                }
713
                if (count($err) > 0) {
714
                    echo '<fieldset><legend>' . _ERRORS . '</legend>';
715
                    xoops_error($err);
716
                    echo '</fieldset>';
717
                } else {
718
                    echo '<fieldset><legend>' . _IMGMANAGER . '</legend>';
719
                    echo '<table style="width:100%;"><thead><tr>
720
    <td>&nbsp;</td>
721
    <td style="border: 1px double #000000; text-align: center;">' . _IMAGENAME . '</td>
722
    <td style="border: 1px double #000000; text-align: center;">' . _IMAGEMIME . '</td>
723
    <td style="border: 1px double #000000; text-align: center;">' . _OPTIONS . '</td>
724
    </tr></thead><tbody>
725
    ';
726
                    echo '<tr><td width="30%" style="text-align: center;">';
727
                    if ('db' === $imagecategory->getVar('imgcat_storetype')) {
728
                        $imagem_url = XOOPS_URL . '/image.php?id=' . $image->getVar('image_id');
729
                        $url        = '/image.php?id=' . $image->getVar('image_id');
730
                    } else {
731
                        $imagem_url = XOOPS_UPLOAD_URL . '/' . $image->getVar('image_name');
732
                        $url        = '/uploads/' . $image->getVar('image_name');
733
                    }
734
                    echo '<img src="'
735
                         . $imagem_url
736
                         . '" alt="" width="50" onmouseover="this.style.border=\'2px solid black\'"  onmouseout="this.style.border=\'2px solid white\'" style="border:2px solid white" onclick="addItem(\''
737
                         . $url
738
                         . '\', \''
739
                         . $image->getVar('image_nicename')
740
                         . '\', \''
741
                         . $target
742
                         . '\', \''
743
                         . $image->getVar('imgcat_id')
744
                         . '\')">';
745
                    echo '</td><td style="border: 2px double #F0F0EE; text-align: center;">' . $image->getVar('image_nicename') . '</td><td style="border: 2px double #F0F0EE; text-align: center;">' . $image->getVar('image_mimetype') . '</td>';
746
                    echo '<td style="border: 2px double #F0F0EE; text-align: center;"><a href="javascript:void(0)" onclick="addItem(\'' . $url . '\', \'' . $image->getVar('image_nicename') . '\', \'' . $target . '\', \'' . $image->getVar('imgcat_id') . '\')">' . _SELECT . '</a></td></tr>';
747
                }
748
                echo '</tbody></table></fieldset>';
749
            }
750
            echo '<h3>' . _ADDIMAGE . '</h3>';
751
            $imgcatHandler = xoops_getHandler('imagecategory');
752
            $catcount      = count($imagecategorysWrite);
753
            if (!empty($catcount)) {
754
                $form = new \XoopsThemeForm(_ADDIMAGE, 'image_form', Request::getString('PHP_SELF', '', 'SERVER'), 'post', true);
755
                $form->setExtra('enctype="multipart/form-data"');
756
                $form->addElement(new \XoopsFormText(_IMAGENAME, 'image_nicename', 50, 255));
757
                $select = new \XoopsFormSelect(_IMAGECAT, 'imgcat_id');
758
                $select->addOptionArray($imgcatHandler->getList($groups, 'imgcat_write', 1));
0 ignored issues
show
The method getList() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of XoopsObjectHandler such as XoopsModuleHandler or XoopsImageHandler or XoopsRankHandler or XoopsCommentHandler or XoopsTplsetHandler or XoopsAvatarHandler or XoopsBlockHandler or XoopsImagesetHandler or XoopsPersistableObjectHandler or XoopsImagecategoryHandler. ( Ignorable by Annotation )

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

758
                $select->addOptionArray($imgcatHandler->/** @scrutinizer ignore-call */ getList($groups, 'imgcat_write', 1));
Loading history...
759
                $form->addElement($select);
760
                $form->addElement(new \XoopsFormFile(_IMAGEFILE, 'image_file', 5000000));
761
                $form->addElement(new \XoopsFormText(_IMGWEIGHT, 'image_weight', 3, 4, 0));
762
                $form->addElement(new \XoopsFormRadioYN(_IMGDISPLAY, 'image_display', 1, _YES, _NO));
763
                $form->addElement(new \XoopsFormHidden('op', 'addfile'));
764
                $form->addElement(new \XoopsFormHidden('target', $target));
765
                $form->addElement(new \XoopsFormButton('', 'img_button', _SUBMIT, 'submit'));
766
                $form->display();
767
            } ?>
768
        </div>
769
        <?php
770
    } ?>
771
772
    <?php if ($admin) {
773
        ?>
774
        <div class="tabbertab<?php echo ('addcat' === $op) ? ' tabbertabdefault' : ''; ?>">
775
            <h2><?php echo _ADD . ' ' . _IMAGECAT ?></h2>
776
            <?php
777
            $form = new \XoopsThemeForm(_MD_ADDIMGCAT, 'imagecat_form', Request::getString('PHP_SELF', '', 'SERVER'), 'post', true);
778
            $form->addElement(new \XoopsFormText(_MD_IMGCATNAME, 'imgcat_name', 50, 255), true);
779
            $form->addElement(new \XoopsFormSelectGroup(_MD_IMGCATRGRP, 'readgroup', true, XOOPS_GROUP_ADMIN, 5, true));
780
            $form->addElement(new \XoopsFormSelectGroup(_MD_IMGCATWGRP, 'writegroup', true, XOOPS_GROUP_ADMIN, 5, true));
781
            $form->addElement(new \XoopsFormText(_IMGMAXSIZE, 'imgcat_maxsize', 10, 10, 50000));
782
            $form->addElement(new \XoopsFormText(_IMGMAXWIDTH, 'imgcat_maxwidth', 3, 4, 120));
783
            $form->addElement(new \XoopsFormText(_IMGMAXHEIGHT, 'imgcat_maxheight', 3, 4, 120));
784
            $form->addElement(new \XoopsFormText(_MD_IMGCATWEIGHT, 'imgcat_weight', 3, 4, 0));
785
            $form->addElement(new \XoopsFormRadioYN(_MD_IMGCATDISPLAY, 'imgcat_display', 1, _YES, _NO));
786
            $storetype = new \XoopsFormRadio(_MD_IMGCATSTRTYPE . '<br><span style="color:#ff0000;">' . _MD_STRTYOPENG . '</span>', 'imgcat_storetype', 'file');
787
            $storetype->addOptionArray(['file' => _MD_ASFILE, 'db' => _MD_INDB]);
788
            $form->addElement($storetype);
789
            $form->addElement(new \XoopsFormHidden('op', 'addcat'));
790
            $form->addElement(new \XoopsFormHidden('target', $target));
791
            $form->addElement(new \XoopsFormButton('', 'imgcat_button', _SUBMIT, 'submit'));
792
            $form->display(); ?>
793
        </div>
794
        <?php
795
    } ?>
796
    <div style="float: right;">
797
        <input type="button" id="cancel" name="cancel" value="<?php echo _CLOSE ?>" onclick="window.close();">
798
    </div>
799
</div>
800
801
//<!--{xo-logger-output}-->
802
803
</body>
804
</html>
805