Issues (55)

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.

src/models/SiteSettings.php (1 issue)

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
/**
4
 * @copyright  Copyright (c) Flipbox Digital Limited
5
 * @license    https://flipboxfactory.com/software/organization/license
6
 * @link       https://www.flipboxfactory.com/software/organization/
7
 */
8
9
namespace flipbox\organizations\models;
10
11
use Craft;
12
use craft\validators\UriFormatValidator;
13
use flipbox\craft\ember\helpers\ModelHelper;
14
use flipbox\craft\ember\models\SiteAttributeTrait;
15
use yii\base\Model;
16
17
/**
18
 * @author Flipbox Factory <[email protected]>
19
 * @since 1.0.0
20
 */
21
class SiteSettings extends Model implements SiteSettingsInterface
22
{
23
    use SiteAttributeTrait;
24
25
    /**
26
     * @var boolean Has URLs
27
     */
28
    public $enabledByDefault = true;
29
30
    /**
31
     * @var boolean Has URLs
32
     */
33
    public $hasUrls = false;
34
35
    /**
36
     * @var string URL format
37
     */
38
    public $uriFormat;
39
40
    /**
41
     * @var string Template
42
     */
43
    public $template;
44
45
    /**
46
     * @inheritdoc
47
     */
48
    public function attributes()
49
    {
50
        return array_merge(
51
            parent::attributes(),
52
            $this->siteAttributes()
53
        );
54
    }
55
56
    /**
57
     * @return bool
58
     */
59
    public function hasUrls(): bool
60
    {
61
        return (bool)$this->hasUrls;
62
    }
63
64
    /**
65
     * @return string
66
     */
67
    public function getUriFormat()
68
    {
69
        return $this->uriFormat;
70
    }
71
72
    /**
73
     * @return string
74
     */
75
    public function getTemplate()
76
    {
77
        return $this->template;
78
    }
79
80
    /**
81
     * @inheritdoc
82
     */
83
    public function attributeLabels()
84
    {
85
        return array_merge(
86
            parent::attributeLabels(),
87
            $this->siteAttributeLabels(),
88
            [
89
                'hasUrls' => Craft::t('app', 'Has Urls'),
90
                'uriFormat' => Craft::t('app', 'URI Format'),
91
                'template' => Craft::t('app', 'Template'),
92
                'enabledByDefault' => Craft::t('app', 'Enabled by Default')
93
            ]
94
        );
95
    }
96
97
    /**
98
     * @inheritdoc
99
     */
100
    public function rules()
101
    {
102
        return array_merge(
103
            parent::rules(),
104
            $this->siteRules(),
105
            [
106
                [
107
                    [
108
                        'template'
109
                    ],
110
                    'string',
111
                    'max' => 500
112
                ],
113
                [
114
                    [
115
                        'uriFormat'
116
                    ],
117
                    UriFormatValidator::class
118
                ],
119
                [
120
                    [
121
                        'enabledByDefault',
122
                        'hasUrls',
123
                        'uriFormat',
124
                        'template'
125
                    ],
126
                    'safe',
127
                    'on' => [
128
                        ModelHelper::SCENARIO_DEFAULT
0 ignored issues
show
Deprecated Code introduced by
The constant flipbox\craft\ember\help...elper::SCENARIO_DEFAULT has been deprecated with message: Use `yii\base\Model::SCENARIO_DEFAULT`

This class constant has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the constant will be removed from the class and what other constant to use instead.

Loading history...
129
                    ]
130
                ],
131
                [
132
                    [
133
                        'uriFormat',
134
                        'template'
135
                    ],
136
                    'required',
137
                    'when' => function ($model) {
138
                        return $model->hasUrls == true;
139
                    },
140
                    'enableClientValidation' => false
141
                ]
142
            ]
143
        );
144
    }
145
}
146