Issues (1020)

Security Analysis    no vulnerabilities found

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.

controllers/SiteController.php (23 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
class SiteController extends GameController
3
{
4
    public function actionIndex()
5
    {
6
        $wall = new Wall;
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 6 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
7
        $wall->uid = Yii::app()->player->uid;
0 ignored issues
show
The property uid cannot be accessed from this context as it is declared private in class Wall.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
8
        $wall->fetchPosts();
9
10
        if (Yii::app()->player->model->level < 2) {
11
            Yii::app()->user->setFlash('info', 'Kezdetnek teljesíts pár megbízást. :) A megbízásokat a '. CHtml::link('Navigáció', ['#left-panel'], ['data-role'=>'button', 'data-inline'=>'true', 'id'=>'nav', 'data-icon'=>'bars', 'data-iconpos'=>'notext']) . ' ikon lenyomásával érheted el.');
12
        }
13
14
        $this->render('index', [
15
            'posts'=>$wall->posts,
0 ignored issues
show
The property posts cannot be accessed from this context as it is declared private in class Wall.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
16
            'banner'=>(date("nd") == Yii::app()->params['smsDate']) ? Yii::app()->params['smsText'] : '',
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal nd does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
17
            ]);
18
    }
19
20
    public function actionCredits()
21
    {
22
        $this->render('credits');
23
    }
24
25
    public function actionStory()
26
    {
27
        $this->render('story');
28
    }
29
30
    public function actionHelp()
31
    {
32
        $help = new Help;
33
        $news = [];
34
        foreach ($help->topics as $topic => $name) {
0 ignored issues
show
The property topics cannot be accessed from this context as it is declared private in class Help.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
35
            $help->topic = (string)$topic;
0 ignored issues
show
The property topic cannot be accessed from this context as it is declared private in class Help.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
36
            $help->fetchItems(1);
37
            $items = $help->items;
0 ignored issues
show
The property items cannot be accessed from this context as it is declared private in class Help.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
38
39
            $news[$topic] = [
40
                'title'=>$name,
41
                'body'=>array_shift($items)
42
                ];
43
        }
44
45
        $this->render('help', [
46
            'news'=>$news,
47
            ]);
48
    }
49
50
    public function actionHelpTopic($t = '')
51
    {
52
        $help = new Help;
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 3 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
53
        $topics = $help->topics;
0 ignored issues
show
The property topics cannot be accessed from this context as it is declared private in class Help.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
54
        if (!array_key_exists($t, $topics)) {
55
            Yii::app()->user->setFlash('error', 'A választott súgótémakör nem létezik.');
56
            $this->redirect(['site/help']);
57
        }
58
59
        $help->topic = $t;
0 ignored issues
show
The property topic cannot be accessed from this context as it is declared private in class Help.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
60
        $help->fetchItems();
61
62
        $this->render('helptopic', [
63
            'title'=>$topics[$t],
64
            'items'=>$help->items,
0 ignored issues
show
The property items cannot be accessed from this context as it is declared private in class Help.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
65
            ]);
66
    }
67
68
    public function actionSms($id = 1)
69
    {
70
        $store = new Store;
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 6 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
71
        $store->uid = Yii::app()->player->model->uid;
0 ignored issues
show
The property uid cannot be accessed from this context as it is declared private in class Store.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
72
        if (!array_key_exists($id, $store->packagesSms)) {
73
            $id = 1;
74
        }
75
76
        $this->render('sms', [
77
            'package'=>$store->packagesSms[$id],
78
            ]);
79
    }
80
81
    public function actionStore()
82
    {
83
        $store = new Store;
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 6 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
84
        $store->uid = Yii::app()->player->model->uid;
0 ignored issues
show
The property uid cannot be accessed from this context as it is declared private in class Store.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
85
86
        $r = Yii::app()->request;
87
88
        $duelShield = new DuelShield();
0 ignored issues
show
Equals sign not aligned with surrounding assignments; expected 6 spaces but found 1 space

This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.

To visualize

$a = "a";
$ab = "ab";
$abc = "abc";

will produce issues in the first and second line, while this second example

$a   = "a";
$ab  = "ab";
$abc = "abc";

will produce no issues.

Loading history...
89
        $duelShield->uid = $store->uid;
0 ignored issues
show
The property uid cannot be accessed from this context as it is declared private in class DuelShield.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
The property uid cannot be accessed from this context as it is declared private in class Store.

This check looks for access to properties that are not accessible from the current context.

If you need to make a property accessible to another context you can either raise its visibility level or provide an accessible getter in the defining class.

Loading history...
90
91
        //duelShield
92
        $shield = (int)$r->getPost('shield', 0);
93
        try {
94
            if ($shield) {
95
                if ($duelShield->activate($shield)) {
96
                    Yii::app()->user->setFlash('success', "Bekapcsoltad a párbaj-pajzsot.");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Bekapcsoltad a párbaj-pajzsot. does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
97
                    $this->redirect(['']);
98
                }
99
            }
100
        } catch (CFlashException $e) {
101
            Yii::app()->user->setFlash('error', $e->getMessage());
102
        }
103
104
        //energy drink
105
        $energy = (int)$r->getPost('energy', 0);
106
        try {
107
            if ($energy) {
108
                if ($store->refillEnergy()) {
109
                    Yii::app()->user->setFlash('success', "Megittál egy energiaitalt, ezáltal teljesen feltöltődtél. Remélem ízlett.");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Megittál egy energiaita...tél. Remélem ízlett. does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
110
                    $this->redirect(['']);
111
                }
112
            }
113
        } catch (CFlashException $e) {
114
            Yii::app()->user->setFlash('error', $e->getMessage());
115
        }
116
117
        //missing set items
118
        $setItem = (int)$r->getPost('setItem', 0);
119
        try {
120
            if ($setItem) {
121
                if ($store->buySetItem($setItem)) {
122
                    Yii::app()->user->setFlash('success', "Megvetted a kiválasztott szett elemet. Ilyen típusút jövő héten vásárolhatsz legközelebb.");
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal Megvetted a kiválasztot... does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
123
                    $this->redirect(['']);
124
                }
125
            }
126
        } catch (CFlashException $e) {
127
            Yii::app()->user->setFlash('error', $e->getMessage());
128
        }
129
130
        $this->render('store', [
131
            'store'=>$store,
132
            'duelShield' => $duelShield,
133
            'shieldPrices' => $duelShield->getPrices(),
134
            'banner'=>(date("nd") == Yii::app()->params['smsDate']) ? Yii::app()->params['smsText'] : '',
0 ignored issues
show
Coding Style Comprehensibility introduced by
The string literal nd does not require double quotes, as per coding-style, please use single quotes.

PHP provides two ways to mark string literals. Either with single quotes 'literal' or with double quotes "literal". The difference between these is that string literals in double quotes may contain variables with are evaluated at run-time as well as escape sequences.

String literals in single quotes on the other hand are evaluated very literally and the only two characters that needs escaping in the literal are the single quote itself (\') and the backslash (\\). Every other character is displayed as is.

Double quoted string literals may contain other variables or more complex escape sequences.

<?php

$singleQuoted = 'Value';
$doubleQuoted = "\tSingle is $singleQuoted";

print $doubleQuoted;

will print an indented: Single is Value

If your string literal does not contain variables or escape sequences, it should be defined using single quotes to make that fact clear.

For more information on PHP string literals and available escape sequences see the PHP core documentation.

Loading history...
135
            ]);
136
    }
137
138
    public function actionLogout()
139
    {
140
        Yii::app()->user->logout();
141
        $this->redirect(Yii::app()->homeUrl);
142
    }
143
}
0 ignored issues
show
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
144