Passed
Pull Request — master (#21)
by Michael
02:48
created

submit.php (8 issues)

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\Tag\FormTag;
23
use XoopsModules\Xoopstube\{
24
    Utility,
25
    Tree
26
};
27
28
require_once __DIR__ . '/header.php';
29
require_once XOOPS_ROOT_PATH . '/header.php';
30
require_once XOOPS_ROOT_PATH . '/class/xoopsformloader.php';
31
32
$mytree = new Tree($GLOBALS['xoopsDB']->prefix('xoopstube_cat'), 'cid', 'pid');
33
34
global $xoopsModule, $myts;
35
36
$xoopsTpl->assign('xoops_module_header', '<link rel="stylesheet" type="text/css" href="' . $moduleDirName . '/assets/css/xtubestyle.css">');
37
38
$cid = Request::getInt('cid', 0); //(int) cleanRequestVars($_REQUEST, 'cid', 0);
39
$lid = Request::getInt('lid', 0); //(int) cleanRequestVars($_REQUEST, 'lid', 0);
40
41
if (false === Utility::checkGroups($cid, 'XTubeSubPerm')) {
42
    redirect_header('index.php', 1, _MD_XOOPSTUBE_NOPERMISSIONTOPOST);
43
}
44
45
if (true === Utility::checkGroups($cid, 'XTubeSubPerm')) {
46
    echo '<div class="row">
47
    <div class="col-md-12">';
48
    echo '<ol class="breadcrumb">
49
        <li><a href="index.php">' . $moduleDirName . '</a></li>
50
        <li>' . _MD_XOOPSTUBE_SUBMITCATHEAD . '</li>
51
    </ol>
52
    ';
53
    //    if (cleanRequestVars($_REQUEST, 'submit', 0)) {
54
    if (Request::hasVar('submit')) {
55
        if (false === Utility::checkGroups($cid, 'XTubeSubPerm')) {
56
            redirect_header('index.php', 1, _MD_XOOPSTUBE_NOPERMISSIONTOPOST);
57
        }
58
59
        $submitter    = (is_object($GLOBALS['xoopsUser']) && !empty($GLOBALS['xoopsUser'])) ? $GLOBALS['xoopsUser']->getVar('uid') : 0;
60
        $vidsource    = Request::getInt('vidsource', 0, 'POST'); // cleanRequestVars($_REQUEST, 'vidsource', 0);
61
        $offline      = Request::getInt('offline', 0, 'POST'); // cleanRequestVars($_REQUEST, 'offline', 0);
62
        $notifypub    = Request::getInt('notifypub', 0, 'POST'); // cleanRequestVars($_REQUEST, 'notifypub', 0);
63
        $approve      = Request::getInt('approve', 0, 'POST'); // cleanRequestVars($_REQUEST, 'approve', 0);
64
        $vidrating    = Request::getInt('vidrating', 0, 'POST'); // cleanRequestVars($_REQUEST, 'vidrating', 0);
65
        $vidid        = Request::getString('vidid', 0, 'POST'); // $myts->addslashes(ltrim(Request::getInt('vidid', 0, 'POST')));
66
        $title        = Request::getString('title', '', 'POST'); // $myts->addslashes(ltrim($_REQUEST['title']));
67
        $descriptionb = Request::getString('descriptionb', '', 'POST'); // $myts->addslashes(ltrim($_REQUEST['descriptionb']));
68
        $publisher    = Request::getString('publisher', '', 'POST'); // $myts->addslashes(trim($_REQUEST['publisher']));
69
        $time         = Request::getString('time', '', 'POST'); // $myts->addslashes(ltrim($_REQUEST['time']));
70
        $keywords     = Request::getString('keywords', '', 'POST'); // $myts->addslashes(trim($_REQUEST['keywords']));
71
        $item_tag     = Request::getString('item_tag', '', 'POST'); // $myts->addslashes(ltrim($_REQUEST['item_tag']));
72
        $picurl       = Request::getString('picurl', '', 'POST'); // $myts->addslashes(ltrim($_REQUEST['picurl']));
73
        $date         = time();
74
        $publishdate  = 0;
75
        $ipaddress    = $_SERVER['REMOTE_ADDR'];
76
77
        if (0 == $lid) {
78
            $status      = 0;
79
            $publishdate = 0;
80
            $message     = _MD_XOOPSTUBE_THANKSFORINFO;
81
            if (true === Utility::checkGroups($cid, 'XTubeAutoApp')) {
82
                $publishdate = time();
83
                $status      = 1;
84
                $message     = _MD_XOOPSTUBE_ISAPPROVED;
85
            }
86
            $sql = 'INSERT INTO '
87
                   . $GLOBALS['xoopsDB']->prefix('xoopstube_videos')
88
                   . '  (lid, cid, title, vidid, submitter, publisher, status, date, hits, rating, votes, comments, vidsource, published, expired, offline, description, ipaddress, notifypub, vidrating, time, keywords, item_tag, picurl) ';
89
            $sql .= " VALUES    (0, $cid, '$title', '$vidid', '$submitter', '$publisher', '$status', '$date', 0, 0, 0, 0, '$vidsource', '$publishdate', 0, '$offline', '$descriptionb', '$ipaddress', '$notifypub', '$vidrating', '$time', '$keywords', '$item_tag', '$picurl')";
90
            if (!$result = $GLOBALS['xoopsDB']->query($sql)) {
91
                $_error = $GLOBALS['xoopsDB']->error() . ' : ' . $GLOBALS['xoopsDB']->errno();
92
                /** @var \XoopsLogger $logger */
93
                $logger = \XoopsLogger::getInstance();
94
                $logger->handleError(E_USER_WARNING, $_error, __FILE__, __LINE__);
95
            }
96
            $newid = $GLOBALS['xoopsDB']->getInsertId();
97
98
            // Add item_tag to Tag-module
99
            if (0 == $lid) {
100
                $tagupdate = Utility::updateTag($newid, $item_tag);
0 ignored issues
show
Are you sure the assignment to $tagupdate is correct as XoopsModules\Xoopstube\U...eTag($newid, $item_tag) targeting XoopsModules\Xoopstube\Utility::updateTag() seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

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

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

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

Loading history...
101
            } else {
102
                $tagupdate = Utility::updateTag($lid, $item_tag);
0 ignored issues
show
Are you sure the assignment to $tagupdate is correct as XoopsModules\Xoopstube\U...ateTag($lid, $item_tag) targeting XoopsModules\Xoopstube\Utility::updateTag() seems to always return null.

This check looks for function or method calls that always return null and whose return value is assigned to a variable.

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

}

$a = new A();
$object = $a->getObject();

The method getObject() can return nothing but null, so it makes no sense to assign that value to a variable.

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

Loading history...
103
            }
104
105
            // Notify of new link (anywhere) and new link in category
106
            /** @var \XoopsNotificationHandler $notificationHandler */
107
            $notificationHandler = xoops_getHandler('notification');
108
109
            $tags               = [];
110
            $tags['VIDEO_NAME'] = $title;
111
            $tags['VIDEO_URL']  = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/singlevideo.php?cid=' . $cid . '&amp;lid=' . $newid;
112
113
            $sql    = 'SELECT title FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_cat') . ' WHERE cid=' . $cid;
114
            $result = $GLOBALS['xoopsDB']->query($sql);
115
            $row    = $GLOBALS['xoopsDB']->fetchArray($result);
116
117
            $tags['CATEGORY_NAME'] = $row['title'];
118
            $tags['CATEGORY_URL']  = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewcat.php?cid=' . $cid;
119
            if (true === Utility::checkGroups($cid, 'XTubeAutoApp')) {
120
                $notificationHandler->triggerEvent('global', 0, 'new_video', $tags);
121
                $notificationHandler->triggerEvent('category', $cid, 'new_video', $tags);
122
                redirect_header('index.php', 2, _MD_XOOPSTUBE_ISAPPROVED);
123
            } else {
124
                $tags['WAITINGFILES_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/newvideos.php';
125
                $notificationHandler->triggerEvent('global', 0, 'video_submit', $tags);
126
                $notificationHandler->triggerEvent('category', $cid, 'video_submit', $tags);
127
                if ($notifypub) {
128
                    require_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
129
                    $notificationHandler->subscribe('video', $newid, 'approve', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
130
                }
131
                redirect_header('index.php', 2, _MD_XOOPSTUBE_THANKSFORINFO);
132
            }
133
        } else {
134
            if (true === Utility::checkGroups($cid, 'XTubeAutoApp') || 1 === $approve) {
135
                $updated = time();
136
                $sql     = 'UPDATE '
137
                           . $GLOBALS['xoopsDB']->prefix('xoopstube_videos')
138
                           . " SET cid=$cid, title='$title', vidid='$vidid', publisher='$publisher', updated='$updated', offline='$offline', description='$descriptionb', ipaddress='$ipaddress', notifypub='$notifypub', vidrating='$vidrating', time='$time', keywords='$keywords', item_tag='$item_tag', picurl='$picurl' WHERE lid ="
139
                           . $lid;
140
                if (!$result = $GLOBALS['xoopsDB']->query($sql)) {
141
                    $_error = $GLOBALS['xoopsDB']->error() . ' : ' . $GLOBALS['xoopsDB']->errno();
142
                    $logger->handleError(E_USER_WARNING, $_error, __FILE__, __LINE__);
143
                }
144
145
                $notificationHandler   = xoops_getHandler('notification');
146
                $tags                  = [];
147
                $tags['VIDEO_NAME']    = $title;
148
                $tags['VIDEO_URL']     = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/singlevideo.php?cid=' . $cid . '&amp;lid=' . $lid;
149
                $sql                   = 'SELECT title FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_cat') . ' WHERE cid=' . $cid;
150
                $result                = $GLOBALS['xoopsDB']->query($sql);
151
                $row                   = $GLOBALS['xoopsDB']->fetchArray($result);
152
                $tags['CATEGORY_NAME'] = $row['title'];
153
                $tags['CATEGORY_URL']  = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewcat.php?cid=' . $cid;
154
155
                $notificationHandler->triggerEvent('global', 0, 'new_video', $tags);
0 ignored issues
show
The method triggerEvent() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of XoopsObjectHandler such as XoopsNotificationHandler 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

155
                $notificationHandler->/** @scrutinizer ignore-call */ 
156
                                      triggerEvent('global', 0, 'new_video', $tags);
Loading history...
156
                $notificationHandler->triggerEvent('category', $cid, 'new_video', $tags);
157
                $_message = _MD_XOOPSTUBE_ISAPPROVED;
158
            } else {
159
                $submitter_array = $GLOBALS['xoopsDB']->fetchArray($GLOBALS['xoopsDB']->query('SELECT submitter FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_videos') . ' WHERE lid=' . $lid));
160
                $modifysubmitter = $GLOBALS['xoopsUser']->uid();
161
                $requestid       = $modifysubmitter;
162
                $requestdate     = time();
163
                $updated         = Request::getInt('up_dated', time(), 'POST'); //cleanRequestVars($_REQUEST, 'up_dated', time());
164
                if ($modifysubmitter === $submitter_array['submitter']) {
165
                    $sql = 'INSERT INTO ' . $GLOBALS['xoopsDB']->prefix('xoopstube_mod') . ' (requestid, lid, cid, title, vidid, publisher, vidsource, description, modifysubmitter, requestdate, time, keywords, item_tag, picurl)';
166
                    $sql .= " VALUES ('', $lid, $cid, '$title', '$vidid', '$publisher', '$vidsource', '$descriptionb', '$modifysubmitter', '$requestdate', '$time', '$keywords', '$item_tag', '$picurl')";
167
                    if (!$result = $GLOBALS['xoopsDB']->query($sql)) {
168
                        $_error = $GLOBALS['xoopsDB']->error() . ' : ' . $GLOBALS['xoopsDB']->errno();
169
                        $logger->handleError(E_USER_WARNING, $_error, __FILE__, __LINE__);
170
                    }
171
                } else {
172
                    redirect_header('index.php', 2, _MD_XOOPSTUBE_MODIFYNOTALLOWED);
173
                }
174
175
                $tags                      = [];
176
                $tags['MODIFYREPORTS_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/index.php?op=listModReq';
177
                $notificationHandler       = xoops_getHandler('notification');
178
                $notificationHandler->triggerEvent('global', 0, 'video_modify', $tags);
179
180
                $tags['WAITINGFILES_URL'] = XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/admin/index.php?op=listNewvideos';
181
                $notificationHandler->triggerEvent('global', 0, 'video_submit', $tags);
182
                $notificationHandler->triggerEvent('category', $cid, 'video_submit', $tags);
183
                if ($notifypub) {
184
                    require_once XOOPS_ROOT_PATH . '/include/notification_constants.php';
185
                    $notificationHandler->subscribe('video', $newid, 'approve', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
0 ignored issues
show
The method subscribe() does not exist on XoopsObjectHandler. It seems like you code against a sub-type of XoopsObjectHandler such as XoopsNotificationHandler 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

185
                    $notificationHandler->/** @scrutinizer ignore-call */ 
186
                                          subscribe('video', $newid, 'approve', XOOPS_NOTIFICATION_MODE_SENDONCETHENDELETE);
Loading history...
186
                }
187
                $_message = _MD_XOOPSTUBE_THANKSFORINFO;
188
            }
189
            redirect_header('index.php', 2, $_message);
190
        }
191
    } else {
192
        $approve = Request::getInt('approve', 0, 'POST'); // cleanRequestVars($_REQUEST, 'approve', 0);
193
194
        // Show disclaimer
195
        if ($GLOBALS['xoopsModuleConfig']['showdisclaimer'] && !Request::getInt('agree', '', 'GET') && 0 == $approve) {
0 ignored issues
show
'' of type string is incompatible with the type integer expected by parameter $default of Xmf\Request::getInt(). ( Ignorable by Annotation )

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

195
        if ($GLOBALS['xoopsModuleConfig']['showdisclaimer'] && !Request::getInt('agree', /** @scrutinizer ignore-type */ '', 'GET') && 0 == $approve) {
Loading history...
196
            echo '<br><div style="text-align: center;">' . Utility::renderImageHeader() . '</div><br>';
197
            echo '<h4>' . _MD_XOOPSTUBE_DISCLAIMERAGREEMENT . '</h4>';
198
            echo '<div>' . $myts->displayTarea($GLOBALS['xoopsModuleConfig']['disclaimer'], 1, 1, 1, 1, 1) . '</div>';
199
            echo '<form action="submit.php" method="post">';
200
            echo '<div style="text-align: center;">' . _MD_XOOPSTUBE_DOYOUAGREE . '</b><br><br>';
201
            echo '<input type="button" onclick="location=\'submit.php?agree=1\'" class="formButton" value="' . _MD_XOOPSTUBE_AGREE . '" alt="' . _MD_XOOPSTUBE_AGREE . '">';
202
            echo '&nbsp;';
203
            echo '<input type="button" onclick="location=\'index.php\'" class="formButton" value="' . _CANCEL . '" alt="' . _CANCEL . '">';
204
            echo '</div></form>';
205
            require_once XOOPS_ROOT_PATH . '/footer.php';
206
            exit();
207
        }
208
        //        echo '<br><div style="text-align: center;">' . Utility::renderImageHeader() . '</div><br>';
209
        echo '<div>' . _MD_XOOPSTUBE_SUB_SNEWMNAMEDESC . '</div>';
210
        //        echo "<div class='xoopstube_singletitle'>" . _MD_XOOPSTUBE_SUBMITCATHEAD . "</div>\n";
211
212
        $sql         = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_videos') . ' WHERE lid=' . $lid;
213
        $video_array = $GLOBALS['xoopsDB']->fetchArray($GLOBALS['xoopsDB']->query($sql));
214
215
        $lid          = $video_array['lid'] ?? 0;
216
        $cid          = $video_array['cid'] ?? 0;
217
        $title        = isset($video_array['title']) ? htmlspecialchars($video_array['title']) : '';
218
        $vidid        = isset($video_array['vidid']) ? htmlspecialchars($video_array['vidid']) : '';
219
        $picurl       = isset($video_array['picurl']) ? htmlspecialchars($video_array['picurl']) : 'http://';
220
        $publisher    = isset($video_array['publisher']) ? htmlspecialchars($video_array['publisher']) : '';
221
        $screenshot   = isset($video_array['screenshot']) ? htmlspecialchars($video_array['screenshot']) : '';
222
        $descriptionb = isset($video_array['description']) ? htmlspecialchars($video_array['description']) : '';
223
        $published    = $video_array['published'] ?? time();
224
        $expired      = $video_array['expired'] ?? 0;
225
        $updated      = $video_array['updated'] ?? 0;
226
        $offline      = $video_array['offline'] ?? 0;
227
        $vidsource    = $video_array['vidsource'] ?? 0;
228
        $ipaddress    = $video_array['ipaddress'] ?? 0;
229
        $notifypub    = $video_array['notifypub'] ?? 0;
230
        $vidrating    = $video_array['vidrating'] ?? 1;
231
        $time         = isset($video_array['time']) ? htmlspecialchars($video_array['time']) : '0:00:00';
232
        $keywords     = isset($video_array['keywords']) ? htmlspecialchars($video_array['keywords']) : '';
233
        $item_tag     = isset($video_array['item_tag']) ? htmlspecialchars($video_array['item_tag']) : '';
234
235
        $sform = new \XoopsThemeForm(_MD_XOOPSTUBE_SUBMITCATHEAD, 'storyform', xoops_getenv('SCRIPT_NAME'), 'post', true);
236
        $sform->setExtra('enctype="multipart/form-data"');
237
238
        Utility::setNoIndexNoFollow();
239
240
        // Video title form
241
        $sform->addElement(new \XoopsFormText(_MD_XOOPSTUBE_FILETITLE, 'title', 70, 255, $title), true);
242
243
        // Video source form
244
        $vidsource_array  = [
245
            0   => _MD_XOOPSTUBE_YOUTUBE,
246
            1   => _MD_XOOPSTUBE_METACAFE,
247
            2   => _MD_XOOPSTUBE_IFILM,
248
            3   => _MD_XOOPSTUBE_PHOTOBUCKET,
249
            4   => _MD_XOOPSTUBE_VIDDLER,
250
            100 => _MD_XOOPSTUBE_GOOGLEVIDEO,
251
            101 => _MD_XOOPSTUBE_MYSPAVETV,
252
            102 => _MD_XOOPSTUBE_DAILYMOTION,
253
            103 => _MD_XOOPSTUBE_BLIPTV,
254
            104 => _MD_XOOPSTUBE_CLIPFISH,
255
            105 => _MD_XOOPSTUBE_LIVELEAK,
256
            106 => _MD_XOOPSTUBE_MAKTOOB,
257
            107 => _MD_XOOPSTUBE_VEOH,
258
            108 => _MD_XOOPSTUBE_VIMEO,
259
            109 => _MD_XOOPSTUBE_MEGAVIDEO,
260
            200 => _MD_XOOPSTUBE_XOOPSTUBE,
261
        ];
262
        $vidsource_select = new \XoopsFormSelect(_MD_XOOPSTUBE_VIDSOURCE, 'vidsource', $vidsource);
263
        $vidsource_select->addOptionArray($vidsource_array);
264
        $sform->addElement($vidsource_select, false);
265
266
        // Video code form
267
        $videocode = new \XoopsFormText(_MD_XOOPSTUBE_DLVIDID, 'vidid', 70, 512, $vidid);
268
        $videocode->setDescription('<br><span style="font-size: small;">' . _MD_XOOPSTUBE_VIDEO_DLVIDIDDSC . '</span>');
269
        $sform->addElement($videocode, true);
270
        $sform->addElement(new \XoopsFormLabel('', _MD_XOOPSTUBE_VIDEO_DLVIDID_NOTE));
271
272
        // Picture url form
273
        $picurl = new \XoopsFormText(_MD_XOOPSTUBE_VIDEO_PICURL, 'picurl', 70, 255, $picurl);
274
        $picurl->setDescription('<br><span style="font-weight: normal;">' . _MD_XOOPSTUBE_VIDEO_PICURLNOTE . '</span>');
275
        $sform->addElement($picurl, false);
276
277
        // Video publisher form
278
        $sform->addElement(new \XoopsFormText(_MD_XOOPSTUBE_VIDEO_PUBLISHER, 'publisher', 70, 255, $publisher), true);
279
280
        // Category tree
281
        $mytree = new Tree($GLOBALS['xoopsDB']->prefix('xoopstube_cat'), 'cid', 'pid');
282
283
        $submitcats = [];
284
        $sql        = 'SELECT * FROM ' . $GLOBALS['xoopsDB']->prefix('xoopstube_cat') . ' ORDER BY title';
285
        $result     = $GLOBALS['xoopsDB']->query($sql);
286
        while (false !== ($myrow = $GLOBALS['xoopsDB']->fetchArray($result))) {
287
            if (true === Utility::checkGroups($myrow['cid'], 'XTubeSubPerm')) {
288
                $submitcats[$myrow['cid']] = $myrow['title'];
289
            }
290
        }
291
292
        // Video time form
293
        $timeform = new \XoopsFormText(_MD_XOOPSTUBE_TIME, 'time', 7, 7, $time);
294
        $timeform->setDescription('<span style="font-size: small;">(h:mm:ss)</span>');
295
        $sform->addElement($timeform, false);
296
297
        // Video category form
298
        ob_start();
299
        $mytree->makeMySelBox('title', 'title', $cid, 0);
300
        $sform->addElement(new \XoopsFormLabel(_MD_XOOPSTUBE_CATEGORYC, ob_get_clean()));
301
302
        // Video description form
303
        //        $editor = xtube_getWysiwygForm( _MD_XOOPSTUBE_DESCRIPTIONC, 'descriptionb', $descriptionb, 10, 50, '');
304
        //        $sform -> addElement( $editor, true );
305
306
        $optionsTrayNote = new \XoopsFormElementTray(_MD_XOOPSTUBE_DESCRIPTIONC, '<br>');
307
        if (class_exists('XoopsFormEditor')) {
308
            $options['name']   = 'descriptionb';
309
            $options['value']  = $descriptionb;
310
            $options['rows']   = 5;
311
            $options['cols']   = '100%';
312
            $options['width']  = '100%';
313
            $options['height'] = '200px';
314
            $editor            = new \XoopsFormEditor('', $GLOBALS['xoopsModuleConfig']['form_optionsuser'], $options, $nohtml = false, $onfailure = 'textarea');
315
            $optionsTrayNote->addElement($editor);
316
        } else {
317
            $editor = new \XoopsFormDhtmlTextArea('', 'descriptionb', $item->getVar('descriptionb', 'e'), '100%', '100%');
0 ignored issues
show
'100%' of type string is incompatible with the type integer expected by parameter $rows of XoopsFormDhtmlTextArea::__construct(). ( Ignorable by Annotation )

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

317
            $editor = new \XoopsFormDhtmlTextArea('', 'descriptionb', $item->getVar('descriptionb', 'e'), /** @scrutinizer ignore-type */ '100%', '100%');
Loading history...
'100%' of type string is incompatible with the type integer expected by parameter $cols of XoopsFormDhtmlTextArea::__construct(). ( Ignorable by Annotation )

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

317
            $editor = new \XoopsFormDhtmlTextArea('', 'descriptionb', $item->getVar('descriptionb', 'e'), '100%', /** @scrutinizer ignore-type */ '100%');
Loading history...
318
            $optionsTrayNote->addElement($editor);
319
        }
320
321
        $sform->addElement($optionsTrayNote, false);
322
323
        // Meta keywords form
324
        $keywords = new \XoopsFormTextArea(_MD_XOOPSTUBE_KEYWORDS, 'keywords', $keywords, 5, 50, false);
0 ignored issues
show
The call to XoopsFormTextArea::__construct() has too many arguments starting with false. ( Ignorable by Annotation )

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

324
        $keywords = /** @scrutinizer ignore-call */ new \XoopsFormTextArea(_MD_XOOPSTUBE_KEYWORDS, 'keywords', $keywords, 5, 50, false);

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress. Please note the @ignore annotation hint above.

Loading history...
325
        $keywords->setDescription('<br><span style="font-size: smaller;">' . _MD_XOOPSTUBE_KEYWORDS_NOTE . '</span>');
326
        $sform->addElement($keywords);
327
328
        if (isset($video_array['item_tag'])) {
329
            if (1 == $GLOBALS['xoopsModuleConfig']['usercantag']) {
330
                // Insert tags if Tag-module is installed
331
                if (Utility::isModuleTagInstalled()) {
332
                    require_once XOOPS_ROOT_PATH . '/modules/tag/include/formtag.php';
333
                    $text_tags = new FormTag('item_tag', 70, 255, $video_array['item_tag'], 0);
334
                    $sform->addElement($text_tags);
335
                }
336
            } else {
337
                $sform->addElement(new \XoopsFormHidden('item_tag', $video_array['item_tag']));
338
            }
339
        }
340
341
        $submitter2 = (is_object($GLOBALS['xoopsUser']) && !empty($GLOBALS['xoopsUser'])) ? $GLOBALS['xoopsUser']->getVar('uid') : 0;
342
        if ($submitter2 > 0) {
343
            $option_tray = new \XoopsFormElementTray(_MD_XOOPSTUBE_OPTIONS, '<br>');
344
345
            if (!$approve) {
346
                $notify_checkbox = new \XoopsFormCheckBox('', 'notifypub');
347
                $notify_checkbox->addOption(1, _MD_XOOPSTUBE_NOTIFYAPPROVE);
348
                $option_tray->addElement($notify_checkbox);
349
            } else {
350
                $sform->addElement(new \XoopsFormHidden('notifypub', 0));
351
            }
352
        }
353
354
        if (true === Utility::checkGroups($cid, 'XTubeAppPerm') && $lid > 0) {
355
            $approve_checkbox = new \XoopsFormCheckBox('', 'approve', $approve);
356
            $approve_checkbox->addOption(1, _MD_XOOPSTUBE_APPROVE);
357
            $option_tray->addElement($approve_checkbox);
358
        } elseif (true === Utility::checkGroups($cid, 'XTubeAutoApp')) {
359
            $sform->addElement(new \XoopsFormHidden('approve', 1));
360
        } else {
361
            $sform->addElement(new \XoopsFormHidden('approve', 0));
362
        }
363
        $sform->addElement($option_tray);
364
365
        $buttonTray = new \XoopsFormElementTray('', '');
366
        $buttonTray->addElement(new \XoopsFormButton('', 'submit', _SUBMIT, 'submit'));
367
        $buttonTray->addElement(new \XoopsFormHidden('lid', $lid));
368
369
        $sform->addElement($buttonTray);
370
        $sform->display();
371
372
        echo '</div></div>';
373
374
        require_once XOOPS_ROOT_PATH . '/footer.php';
375
    }
376
} else {
377
    redirect_header('index.php', 2, _MD_XOOPSTUBE_NOPERMISSIONTOPOST);
378
}
379