GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Issues (21)

Security Analysis    no request data  

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.

MailDefinition/MailDefinitionParserXml.php (4 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 Hautzi\SystemMailBundle\SystemMailer\MailDefinition;
4
5
use Hautzi\SystemMailBundle\SystemMailer\ParsedMessage;
6
use Hautzi\SystemMailBundle\SystemMailer\XML\XsdValidator;
7
8
class MailDefinitionParserXml implements ParserInterface
9
{
10
    /**
11
     * @var XsdValidator
12
     */
13
    private $validator;
14
15
    /**
16
     * @var string
17
     */
18
    private $xsdFile;
19
20
    /**
21
     * @param XsdValidator $validator
22
     * @param              $xsdFile
23
     */
24
    public function __construct(XsdValidator $validator, $xsdFile)
25
    {
26
        $this->validator = $validator;
27
        $this->xsdFile = $xsdFile;
28
    }
29
30
    /**
31
     * Parse XML Mail Definition string
32
     *
33
     * which looks something like this
34
     * <code>
35
     *   <email>
36
     *      <to name="yourname">[email protected]</email>
37
     *      <subject locale="de">Your subject</subject>
38
     *      <messageText locale="de">Your Message</messageText>
39
     *   </email>
40
     * </code>
41
     *
42
     * @param string $xml
43
     * @param string $locale
44
     *
45
     * @return ParsedMessage
46
     *
47
     * @throws \Exception
48
     */
49
    public function parseMailDefinition($xml, $locale = null)
50
    {
51
        $this->validator->validate($xml, $this->xsdFile);
52
53
        $parsed = simplexml_load_string($xml);
54
55
        $message = new ParsedMessage();
56
57
        $from = $parsed->from;
0 ignored issues
show
The property from does not seem to exist in SimpleXMLElement.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
58
        if ($from->count() > 0) {
59
            $message->setFrom((string)$from, (string)$from->attributes()['name']);
60
        }
61
62
        $replyTo = $parsed->replyTo;
0 ignored issues
show
The property replyTo does not seem to exist in SimpleXMLElement.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
63
        if ($replyTo->count() > 0) {
64
            $message->setReplyTo((string)$replyTo);
65
        }
66
67
        foreach ($parsed->to as $to) {
68
            $message->addTo((string)$to, (string)$to->attributes()['name']);
69
        }
70
        foreach ($parsed->cc as $cc) {
71
            $message->addCc((string)$cc, (string)$cc->attributes()['name']);
72
        }
73
        foreach ($parsed->bcc as $bcc) {
74
            $message->addBcc((string)$bcc, (string)$bcc->attributes()['name']);
75
        }
76
77
        $message->setSubject($this->getLocalizedTagContent($parsed->subject, $locale));
78
79
        $message->setMessageHtml($this->getLocalizedTagContent($parsed->messageHtml, $locale));
80
        $message->setMessageText($this->getLocalizedTagContent($parsed->messageText, $locale));
81
82
        return $message;
83
    }
84
85
    /**
86
     * @param \SimpleXMLElement $element
87
     * @param string            $locale
88
     *
89
     * @return string
90
     *
91
     * @throws \Exception
92
     */
93
    protected function getLocalizedTagContent(\SimpleXMLElement $element, $locale = null)
94
    {
95
        if (0 === $element->count()) {
96
            return '';
97
        }
98
99 View Code Duplication
        if (null === $locale) {
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...
100
            return $this->multilineRemoveIndent((string)$element, 'true' === (string)$element->attributes()['removeIndent']);
101
        }
102
103
        foreach ($element as $node) {
104 View Code Duplication
            if ($locale == (string)$node->attributes()['locale']) {
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...
105
                return $this->multilineRemoveIndent((string)$node, 'true' === (string)$node->attributes()['removeIndent']);
106
            }
107
        }
108
109
        $message = sprintf('Locale "%s" not available in node "%s".', $locale, $element->getName());
110
        throw new \Exception($message);
111
    }
112
113
    /**
114
     * @param string $string
115
     * @param bool   $removeThatShit
116
     *
117
     * @return mixed
118
     */
119
    protected function multilineRemoveIndent($string, $removeThatShit = false)
120
    {
121
        if (!$removeThatShit) {
122
            return $string;
123
        }
124
125
        return trim(preg_replace('@^ *@m', '', $string));
126
    }
127
}
128