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.

class/Form/Elements/SmartFormRadioElement.php (3 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 namespace XoopsModules\Smartobject\Form\Elements;
2
3
/**
4
 * Contains the SmartObjectControl class
5
 *
6
 * @license    GNU
7
 * @author     marcan <[email protected]>
8
 * @link       http://smartfactory.ca The SmartFactory
9
 * @package    SmartObject
10
 * @subpackage SmartObjectForm
11
 */
12
13
use XoopsModules\Smartobject;
14
15
/**
16
 * Class SmartFormRadioElement
17
 * @package XoopsModules\Smartobject\Form\Elements
18
 */
19
class SmartFormRadioElement extends \XoopsFormRadio
20
{
21
    /**
22
     * SmartFormRadioElement constructor.
23
     * @param string $object
24
     * @param string $key
25
     */
26
    public function __construct($object, $key)
27
    {
28
        $var = $object->vars[$key];
29
30
        parent::__construct($var['form_caption'], $key, $object->getVar($key, 'e'));
0 ignored issues
show
The method getVar cannot be called on $object (of type string).

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...
31
32
        // Adding the options inside this SelectBox
33
        // If the custom method is not from a module, than it's from the core
34
        $control = $object->getControl($key);
0 ignored issues
show
The method getControl cannot be called on $object (of type string).

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...
35
36 View Code Duplication
        if (isset($control['options'])) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
37
            $this->addOptionArray($control['options']);
38
        } else {
39
            // let's find if the method we need to call comes from an already defined object
40
            if (isset($control['object'])) {
41
                if (method_exists($control['object'], $control['method'])) {
42
                    if ($option_array = $control['object']->{$control['method']}()) {
43
                        // Adding the options array to the XoopsFormSelect
44
                        $this->addOptionArray($option_array);
45
                    }
46
                }
47
            } else {
48
                // finding the itemHandler; if none, let's take the itemHandler of the $object
49
                if (isset($control['itemHandler'])) {
50
                    if (!$control['module']) {
51
                        // Creating the specified core object handler
52
                        $controlHandler = xoops_getHandler($control['itemHandler']);
53
                    } else {
54
                        $controlHandler = xoops_getModuleHandler($control['itemHandler'], $control['module']);
55
                    }
56
                } else {
57
                    $controlHandler = $object->handler;
58
                }
59
60
                // Checking if the specified method exists
61
                if (method_exists($controlHandler, $control['method'])) {
62
                    // TODO: How could I pass the parameters in the following call ...
63
                    if ($option_array = $controlHandler->{$control['method']}()) {
64
                        // Adding the options array to the XoopsFormSelect
65
                        $this->addOptionArray($option_array);
66
                    }
67
                }
68
            }
69
        }
70
    }
71
}
72