Issues (496)

Security Analysis    not enabled

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  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.
  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.
  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.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  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.
  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.
  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.
  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.
  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.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  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.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
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.

admin/tag.php (10 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
use XoopsModules\Smartobject;
4
use XoopsModules\Smartobject\ObjectColumn;
5
use XoopsModules\Smartobject\ObjectController;
6
use XoopsModules\Smartobject\Table;
7
8
/**
9
 *
10
 * Module: SmartShop
11
 * Author: The SmartFactory <www.smartfactory.ca>
12
 * Licence: GNU
13
 * @param int  $tagid
14
 * @param bool $language
15
 * @param bool $fct
16
 */
17
18
function edittag($tagid = 0, $language = false, $fct = false)
0 ignored issues
show
The parameter $fct is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
19
{
20
    global $smartobjectTagHandler;
21
22
    $tagObj = $smartobjectTagHandler->get($tagid);
23
24
    if ($tagObj->isNew()) {
25
        $breadcrumb            = _AM_SOBJECT_TAGS . ' > ' . _AM_SOBJECT_TAG_CREATE;
0 ignored issues
show
$breadcrumb is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
26
        $title                 = _AM_SOBJECT_TAG_CREATE;
27
        $info                  = _AM_SOBJECT_TAG_CREATE_INFO;
28
        $collaps_name          = 'tagcreate';
29
        $form_name             = _AM_SOBJECT_TAG_CREATE;
30
        $submit_button_caption = null;
31
    //$tagObj->stripMultilanguageFields();
32
    } else {
33
        if ($language) {
34
            $breadcrumb            = _AM_SOBJECT_TAGS . ' > ' . _AM_SOBJECT_TAG_EDITING_LANGUAGE;
0 ignored issues
show
$breadcrumb is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
35
            $title                 = _AM_SOBJECT_TAG_EDIT_LANGUAGE;
36
            $info                  = _AM_SOBJECT_TAG_EDIT_LANGUAGE_INFO;
37
            $collaps_name          = 'tageditlanguage';
38
            $form_name             = _AM_SOBJECT_TAG_EDIT_LANGUAGE;
39
            $submit_button_caption = null;
40
            $tagObj->makeNonMLFieldReadOnly();
41
        } else {
42
            $breadcrumb            = _AM_SOBJECT_TAGS . ' > ' . _AM_SOBJECT_EDITING;
0 ignored issues
show
$breadcrumb is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
43
            $title                 = _AM_SOBJECT_TAG_EDIT;
44
            $info                  = _AM_SOBJECT_TAG_EDIT_INFO;
45
            $collaps_name          = 'tagedit';
46
            $form_name             = _AM_SOBJECT_TAG_EDIT;
47
            $submit_button_caption = null;
48
            $tagObj->stripMultilanguageFields();
49
        }
50
    }
51
52
    //Smartobject\Utility::getAdminMenu(2, $breadcrumb);
53
54
    Smartobject\Utility::getCollapsableBar($collaps_name, $title, $info);
55
56
    $sform = $tagObj->getForm($form_name, 'addtag', false, $submit_button_caption);
57
    $sform->display();
58
    Smartobject\Utility::closeCollapsable($collaps_name);
59
}
60
61
require_once __DIR__ . '/admin_header.php';
62
//require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php';
63
//require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttag.php';
64
65
$smartobjectTagHandler = Smartobject\Helper::getInstance()->getHandler('Tag');
66
67
$op = '';
68
69
if (isset($_GET['op'])) {
70
    $op = $_GET['op'];
71
}
72
if (isset($_POST['op'])) {
73
    $op = $_POST['op'];
74
}
75
76
$tagid    = \Xmf\Request::getInt('tagid', 0, 'GET');
77
$fct      = \Xmf\Request::getString('fct', '', 'GET');
78
$language = isset($_GET['language']) ? $_GET['language'] : false;
79
80
switch ($op) {
81
82
    case 'del':
83
//        require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php';
84
        $controller = new ObjectController($smartobjectTagHandler);
85
        $controller->handleObjectDeletion(_AM_SOBJECT_TAG_DELETE_CONFIRM);
0 ignored issues
show
_AM_SOBJECT_TAG_DELETE_CONFIRM is of type string, but the function expects a boolean.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
86
87
        break;
88
89
    case 'addtag':
90
//        require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobjectcontroller.php';
91
        $controller = new ObjectController($smartobjectTagHandler);
92
        $tagObj     = $controller->storeSmartObject();
93
        if ($tagObj->hasError()) {
0 ignored issues
show
The method hasError cannot be called on $tagObj (of type boolean).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
94
            redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR . $tagObj->getHtmlErrors());
0 ignored issues
show
The method getHtmlErrors cannot be called on $tagObj (of type boolean).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
95
        }
96
97
        if ($tagObj->hasError()) {
0 ignored issues
show
The method hasError cannot be called on $tagObj (of type boolean).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
98
            redirect_header($smart_previous_page, 3, _CO_SOBJECT_SAVE_ERROR . $tagObj->getHtmlErrors());
0 ignored issues
show
The method getHtmlErrors cannot be called on $tagObj (of type boolean).

Methods can only be called on objects. This check looks for methods being called on variables that have been inferred to never be objects.

Loading history...
99
        } else {
100
            redirect_header(Smartobject\Utility::getPageBeforeForm(), 3, _CO_SOBJECT_SAVE_SUCCESS);
101
        }
102
        exit;
103
        break;
104
105
    case 'mod':
106
        Smartobject\Utility::getXoopsCpHeader();
107
        edittag($tagid, $language, $fct);
108
        break;
109
110
    default:
111
112
        Smartobject\Utility::getXoopsCpHeader();
113
114
        //Smartobject\Utility::getAdminMenu(2, _AM_SOBJECT_TAGS);
115
116
        Smartobject\Utility::getCollapsableBar('tags', _AM_SOBJECT_TAGS, _AM_SOBJECT_TAGS_INFO);
117
118
//        require_once SMARTOBJECT_ROOT_PATH . 'class/smartobjecttable.php';
119
        $objectTable = new Table($smartobjectTagHandler, false, ['delete']);
0 ignored issues
show
false is of type boolean, but the function expects a null|object<CriteriaElement>.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
120
        $objectTable->addColumn(new ObjectColumn('name'));
121
        $objectTable->addColumn(new ObjectColumn('language'));
122
        $objectTable->addColumn(new ObjectColumn('value'));
123
        //      $objectTable->addColumn(new SmartObjectColumn(_AM_SOBJECT_SENT_TAGS_FROM, $align='left', $width=false, 'getFromInfo'));
124
125
        $objectTable->addFilter('language', 'getLanguages');
126
127
        $objectTable->addCustomAction('getEditLanguageLink');
128
        $objectTable->addCustomAction('getEditItemLink');
129
130
        $objectTable->setDefaultSort('tagid');
131
132
        $objectTable->addIntroButton('addtag', 'tag.php?op=mod', _AM_SOBJECT_TAG_CREATE);
133
134
        $objectTable->render();
135
136
        echo '<br>';
137
        Smartobject\Utility::closeCollapsable('tags');
138
        echo '<br>';
139
140
        break;
141
}
142
143
//Smartobject\Utility::getModFooter();
144
//xoops_cp_footer();
145
require_once __DIR__ . '/admin_footer.php';
146