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/MlObject.php (2 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;
2
3
/**
4
 * Contains the basis classes for managing any objects derived from SmartObjects
5
 *
6
 * @license    GNU
7
 * @author     marcan <[email protected]>
8
 * @link       http://smartfactory.ca The SmartFactory
9
 * @package    SmartObject
10
 * @subpackage SmartObjectCore
11
 */
12
13
use XoopsModules\Smartobject;
14
15
// defined('XOOPS_ROOT_PATH') || die('Restricted access');
16
//require_once XOOPS_ROOT_PATH . '/modules/smartobject/class/smartobject.php';
17
18
/**
19
 * SmartObject base Multilanguage-enabled class
20
 *
21
 * Base class representing a single SmartObject with multilanguages capabilities
22
 *
23
 * @package SmartObject
24
 * @author  marcan <[email protected]>
25
 * @link    http://smartfactory.ca The SmartFactory
26
 */
27
class MlObject extends Smartobject\BaseSmartObject
28
{
29
    /**
30
     * SmartMlObject constructor.
31
     */
32
    public function __construct()
33
    {
34
        $this->initVar('language', XOBJ_DTYPE_TXTBOX, 'english', false, null, '', true, _CO_SOBJECT_LANGUAGE_CAPTION, _CO_SOBJECT_LANGUAGE_DSC, true, true);
35
        $this->setControl('language', 'language');
36
    }
37
38
    /**
39
     * If object is not new, change the control of the not-multilanguage fields
40
     *
41
     * We need to intercept this function from SmartObject because if the object is not new...
42
     */
43
    // function getForm() {
44
45
    //}
46
47
    /**
48
     * Strip Multilanguage Fields
49
     *
50
     * Get rid of all the multilanguage fields to have an object with only global fields.
51
     * This will be usefull when creating the ML object for the first time. Then we will be able
52
     * to create translations.
53
     */
54 View Code Duplication
    public function stripMultilanguageFields()
0 ignored issues
show
This method seems to be duplicated in 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...
55
    {
56
        $objectVars    =& $this->getVars();
57
        $newObjectVars = [];
58
        foreach ($objectVars as $key => $var) {
59
            if (!$var['multilingual']) {
60
                $newObjectVars[$key] = $var;
61
            }
62
        }
63
        $this->vars = $newObjectVars;
64
    }
65
66 View Code Duplication
    public function stripNonMultilanguageFields()
0 ignored issues
show
This method seems to be duplicated in 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...
67
    {
68
        $objectVars    =& $this->getVars();
69
        $newObjectVars = [];
70
        foreach ($objectVars as $key => $var) {
71
            if ($var['multilingual'] || $key == $this->handler->keyName) {
72
                $newObjectVars[$key] = $var;
73
            }
74
        }
75
        $this->vars = $newObjectVars;
76
    }
77
78
    /**
79
     * Make non multilanguage fields read only
80
     *
81
     * This is used when we are creating/editing a translation.
82
     * We only want to edit the multilanguag fields, not the global one.
83
     */
84
    public function makeNonMLFieldReadOnly()
85
    {
86
        foreach ($this->getVars() as $key => $var) {
87
            //if (($key == 'language') || (!$var['multilingual'] && $key <> $this->handler->keyName)) {
88
            if (!$var['multilingual'] && $key != $this->handler->keyName) {
89
                $this->setControl($key, 'label');
90
            }
91
        }
92
    }
93
94
    /**
95
     * @param  bool $onlyUrl
96
     * @param  bool $withimage
97
     * @return string
98
     */
99
    public function getEditLanguageLink($onlyUrl = false, $withimage = true)
100
    {
101
        $controller = new ObjectController($this->handler);
102
103
        return $controller->getEditLanguageLink($this, $onlyUrl, $withimage);
104
    }
105
}
106