Issues (222)

Security Analysis    not enabled

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

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

1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * Copyright (C) 2020-2025 Iain Cambridge
7
 *
8
 * This program is free software: you can redistribute it and/or modify
9
 * it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as published by
10
 * the Free Software Foundation, either version 2.1 of the License, or
11
 * (at your option) any later version.
12
 *
13
 * This program is distributed in the hope that it will be useful,
14
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 * GNU Lesser General Public License for more details.
17
 *
18
 * You should have received a copy of the GNU General Public License
19
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
20
 */
21
22
namespace Parthenon\Notification;
23
24
class Email implements EmailInterface
25
{
26
    private ?string $subject = null;
27
28
    private ?string $fromAddress = null;
29
30
    private ?string $fromName = null;
31
32
    private ?string $toAddress = null;
33
34
    private ?string $toName = null;
35
36
    private ?string $content = null;
37
38
    private ?string $templateName = null;
39
40
    private array $templateVariables = [];
41
42
    /**
43
     * @var Attachment[]
44
     */
45
    private array $attachments = [];
46
47
    public function getSubject(): ?string
48
    {
49
        return $this->subject;
50
    }
51
52
    public function setSubject(?string $subject): self
53
    {
54
        $this->subject = $subject;
55
56
        return $this;
57
    }
58
59
    public function getFromAddress(): ?string
60
    {
61
        return $this->fromAddress;
62
    }
63
64
    public function setFromAddress(?string $fromAddress): self
65
    {
66
        $this->fromAddress = $fromAddress;
67
68
        return $this;
69
    }
70
71
    public function getFromName(): ?string
72
    {
73
        return $this->fromName;
74
    }
75
76
    public function setFromName(?string $fromName): self
77
    {
78
        $this->fromName = $fromName;
79
80
        return $this;
81
    }
82
83
    public function getToAddress(): ?string
84
    {
85
        return $this->toAddress;
86
    }
87
88
    public function setToAddress(?string $toAddress): self
89
    {
90
        $this->toAddress = $toAddress;
91
92
        return $this;
93
    }
94
95
    public function getToName(): ?string
96
    {
97
        return $this->toName;
98
    }
99
100
    public function setToName(?string $toName): self
101
    {
102
        $this->toName = $toName;
103
104
        return $this;
105
    }
106
107
    public function getContent(): ?string
108
    {
109
        return $this->content;
110
    }
111
112
    public function setContent(?string $content): self
113
    {
114
        $this->content = $content;
115
116
        return $this;
117
    }
118
119
    public function getTemplateName(): string
120
    {
121
        return $this->templateName;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->templateName could return the type null which is incompatible with the type-hinted return string. Consider adding an additional type-check to rule them out.
Loading history...
122
    }
123
124
    public function setTemplateName(string $templateName): self
125
    {
126
        $this->templateName = $templateName;
127
128
        return $this;
129
    }
130
131
    public function setTemplateVariables(array $templateVariables): self
132
    {
133
        $this->templateVariables = $templateVariables;
134
135
        return $this;
136
    }
137
138
    public function getTemplateVariables(): array
139
    {
140
        return $this->templateVariables;
141
    }
142
143
    public function isTemplate(): bool
144
    {
145
        return !empty($this->templateName);
146
    }
147
148
    public function addAttachment(Attachment $attachment): self
149
    {
150
        $this->attachments[] = $attachment;
151
152
        return $this;
153
    }
154
155
    /**
156
     * @return Attachment[]
157
     */
158
    public function getAttachments(): array
159
    {
160
        return $this->attachments;
161
    }
162
}
163