Issues (1704)

Branch: master

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.

BusinessPageBundle/Entity/BusinessTemplate.php (8 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
namespace Victoire\Bundle\BusinessPageBundle\Entity;
4
5
use Doctrine\ORM\Mapping as ORM;
6
use Victoire\Bundle\PageBundle\Entity\PageStatus;
7
use Victoire\Bundle\QueryBundle\Entity\QueryTrait;
8
use Victoire\Bundle\QueryBundle\Entity\VictoireQueryInterface;
9
use Victoire\Bundle\SeoBundle\Entity\PageSeo;
10
use Victoire\Bundle\TemplateBundle\Entity\Template;
11
12
/**
13
 * BusinessTemplate.
14
 *
15
 * @ORM\Entity(repositoryClass="Victoire\Bundle\BusinessPageBundle\Repository\BusinessTemplateRepository")
16
 * @ORM\HasLifecycleCallbacks()
17
 */
18
class BusinessTemplate extends Template implements VictoireQueryInterface
19
{
20
    //This trait add the query and business_entity_id columns
21
    use QueryTrait;
22
23
    const TYPE = 'business_template';
24
25
    /**
26
     * @ORM\OneToOne(targetEntity="\Victoire\Bundle\SeoBundle\Entity\PageSeo", cascade={"persist", "remove"})
27
     * @ORM\JoinColumn(name="seo_id", referencedColumnName="id", onDelete="SET NULL")
28
     */
29
    protected $seo;
30
31
    /**
32
     * @ORM\OneToMany(targetEntity="\Victoire\Bundle\BusinessPageBundle\Entity\BusinessPage", mappedBy="template", cascade={"remove"})
33
     */
34
    protected $inheritors;
35
36
    /**
37
     * @var bool
38
     *
39
     * @deprecated author restriction is handled by the "BUSINESS_ENTITY_OWNER" role since 1.7.7 and will be removed in the 1.8
40
     *
41
     * @ORM\Column(name="author_restricted", type="boolean")
42
     */
43
    protected $authorRestricted;
44
45
    /**
46
     * @var string
47
     *
48
     * @ORM\Column(name="backendName", type="string", length=255)
49
     */
50
    protected $backendName;
51
52
    /**
53
     * contruct.
54
     **/
55
    public function __construct()
56
    {
57
        parent::__construct();
58
        $this->publishedAt = new \DateTime();
0 ignored issues
show
The property publishedAt does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
59
        $this->status = PageStatus::PUBLISHED;
0 ignored issues
show
The property status does not exist. Did you maybe forget to declare it?

In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:

class MyClass { }

$x = new MyClass();
$x->foo = true;

Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion:

class MyClass {
    public $foo;
}

$x = new MyClass();
$x->foo = true;
Loading history...
60
    }
61
62
    /**
63
     * @return [BusinessPage]
0 ignored issues
show
The doc-type [BusinessPage] could not be parsed: Unknown type name "" at position 0. [(view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
64
     */
65
    public function getInstances()
66
    {
67
        return $this->inheritors;
68
    }
69
70
    public function setInstances($inheritors)
0 ignored issues
show
Missing function doc comment
Loading history...
71
    {
72
        $this->inheritors = $inheritors;
73
74
        return $this;
75
    }
76
77
    /**
78
     * @return string
79
     */
80
    public function getLayout()
81
    {
82
        return $this->layout ? $this->layout : $this->getTemplate()->getLayout();
83
    }
84
85
    /**
86
     * Set seo.
87
     *
88
     * @param PageSeo $seo
89
     *
90
     * @return BusinessTemplate
91
     */
92
    public function setSeo(PageSeo $seo)
93
    {
94
        $this->seo = $seo;
95
96
        return $this;
97
    }
98
99
    /**
100
     * Get seo.
101
     *
102
     * @return PageSeo
103
     */
104
    public function getSeo()
105
    {
106
        return $this->seo;
107
    }
108
109
    /**
110
     * @return bool
111
     */
112
    public function isAuthorRestricted()
113
    {
114
        return $this->authorRestricted;
0 ignored issues
show
Deprecated Code introduced by
The property Victoire\Bundle\Business...late::$authorRestricted has been deprecated with message: author restriction is handled by the "BUSINESS_ENTITY_OWNER" role since 1.7.7 and will be removed in the 1.8

This property 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 property will be removed from the class and what other property to use instead.

Loading history...
115
    }
116
117
    /**
118
     * @param bool $authorRestricted
119
     */
120
    public function setAuthorRestricted($authorRestricted)
121
    {
122
        $this->authorRestricted = $authorRestricted;
0 ignored issues
show
Deprecated Code introduced by
The property Victoire\Bundle\Business...late::$authorRestricted has been deprecated with message: author restriction is handled by the "BUSINESS_ENTITY_OWNER" role since 1.7.7 and will be removed in the 1.8

This property 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 property will be removed from the class and what other property to use instead.

Loading history...
123
    }
124
125
    /**
126
     * @return string
127
     */
128
    public function getBackendName()
129
    {
130
        return $this->backendName;
131
    }
132
133
    /**
134
     * @param string $backendName
135
     *
136
     * @return $this
137
     */
138
    public function setBackendName($backendName)
139
    {
140
        $this->backendName = $backendName;
141
142
        return $this;
143
    }
144
145
    /**
146
     * Get inheritors (all Templates having this object as Template).
147
     *
148
     * @return [Template]
0 ignored issues
show
The doc-type [Template] could not be parsed: Unknown type name "" at position 0. [(view supported doc-types)

This check marks PHPDoc comments that could not be parsed by our parser. To see which comment annotations we can parse, please refer to our documentation on supported doc-types.

Loading history...
149
     */
150 View Code Duplication
    public function getTemplateInheritors()
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...
151
    {
152
        $templateInheritors = [];
153
        foreach ($this->inheritors as $inheritor) {
154
            if ($inheritor instanceof self) {
155
                $templateInheritors[] = $inheritor;
156
            }
157
        }
158
159
        return $templateInheritors;
160
    }
161
}
162