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 (107)

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/widgets/TbEditableDetailView.php (1 issue)

Labels
Severity

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
 * TbEditableDetailView class file.
4
 *
5
 * @author Vitaliy Potapov <[email protected]>
6
 * @link https://github.com/vitalets/x-editable-yii
7
 * @copyright Copyright &copy; Vitaliy Potapov 2012
8
 * @version 1.3.1
9
 */
10
11
Yii::import('booster.widgets.TbEditableField');
12
Yii::import('zii.widgets.CDetailView');
13
14
/**
15
 * TbEditableDetailView widget makes editable CDetailView (several attributes of single model shown as name-value table).
16
 *
17
 * @package widgets
18
 */
19
class TbEditableDetailView extends CDetailView
20
{
21
22
    public function init()
23
    {
24
        if (!$this->data instanceof CModel) {
0 ignored issues
show
The class CModel does not exist. Did you forget a USE statement, or did you not list all dependencies?

This error could be the result of:

1. Missing dependencies

PHP Analyzer uses your composer.json file (if available) to determine the dependencies of your project and to determine all the available classes and functions. It expects the composer.json to be in the root folder of your repository.

Are you sure this class is defined by one of your dependencies, or did you maybe not list a dependency in either the require or require-dev section?

2. Missing use statement

PHP does not complain about undefined classes in ìnstanceof checks. For example, the following PHP code will work perfectly fine:

if ($x instanceof DoesNotExist) {
    // Do something.
}

If you have not tested against this specific condition, such errors might go unnoticed.

Loading history...
25
            throw new CException('Property "data" should be of CModel class.');
26
        }
27
28
        //set bootstrap css
29
        /* TODO if(yii::app()->editable->form === 'bootstrap') { */
30
            $this->htmlOptions = array('class'=> 'table table-bordered table-striped table-hover');
31
            //disable loading Yii's css for bootstrap
32
            $this->cssFile = false;
33
        // }
34
35
        parent::init();
36
    }
37
38
    protected function renderItem($options, $templateData)
39
    {
40
        //apply editable if not set 'editable' params or set and not false
41
        $apply = !empty($options['name']) && (!isset($options['editable']) || $options['editable'] !== false);
42
43
        if ($apply) {
44
            //ensure $options['editable'] is array
45
            if(!isset($options['editable'])) $options['editable'] = array();
46
47
            //merge options with defaults: url, params, etc.
48
            $options['editable'] = CMap::mergeArray($this->_data, $options['editable']);
49
50
            //options to be passed into TbEditableField (constructed from $options['editable'])
51
            $widgetOptions = array(
52
                'model'     => $this->data,
53
                'attribute' => $options['name']
54
            );
55
56
            //if value in detailview options provided, set text directly (as value here means text)
57
            if(isset($options['value']) && $options['value'] !== null) {
58
                $widgetOptions['text'] = $templateData['{value}'];
59
                $widgetOptions['encode'] = false;
60
            }
61
62
            $widgetOptions = CMap::mergeArray($widgetOptions, $options['editable']);
63
64
            $widget = $this->controller->createWidget('TbEditableField', $widgetOptions);
65
66
            //'apply' maybe changed during init of widget (e.g. if related model has unsafe attribute)
67
            if($widget->apply) {
68
                ob_start();
69
                $widget->run();
70
                $templateData['{value}'] = ob_get_clean();
71
            }
72
        }
73
74
        parent::renderItem($options, $templateData);
75
    }
76
77
    //***************************************************************************************
78
    // Generic getter/setter implementation to accept default configuration for TbEditableField
79
    //***************************************************************************************
80
81
    /** Data for default fields of TbEditableField */
82
    private $_data = array();
83
    /** Valid attributes for TbEditableField (singleton) */
84
    private $_editableProperties;
85
86
    /**
87
     * Get the properties available for {@link TbEditableField}.
88
     *
89
     * These properties can also be set for the {@link TbEditableDetailView} as default values.
90
     */
91
    private function getEditableProperties()
92
    {
93
        if(!isset($this->_editableProperties))
94
        {
95
            $reflection = new ReflectionClass('TbEditableField');
96
            $this->_editableProperties = array_map(
97
	            function(ReflectionProperty $d) { return $d->getName(); },
98
	            $reflection->getProperties()
99
            );
100
        }
101
        return $this->_editableProperties;
102
    }
103
104
	/**
105
	 * (non-PHPdoc)
106
	 * @see CComponent::__get()
107
	 *
108
	 * @param string $key
109
	 *
110
	 * @throws CException
111
	 * @return mixed
112
	 */
113
    public function __get($key) {
114
        return (array_key_exists($key,$this->_data) ? $this->_data[$key] : parent::__get($key));
115
    }
116
117
	/**
118
	 * (non-PHPdoc)
119
	 * @see CComponent::__set()
120
	 *
121
	 * @param string $key
122
	 * @param mixed $value
123
	 *
124
	 * @throws CException
125
	 * @return mixed|void
126
	 */
127
    public function __set($key, $value) {
128
        if(in_array($key,$this->getEditableProperties())) {
129
            $this->_data[$key] = $value;
130
        } else {
131
            parent::__set($key,$value);
132
        }
133
    }
134
135
	/**
136
	 * (non-PHPdoc)
137
	 * @see CComponent::__isset()
138
	 *
139
	 * @param string $name
140
	 *
141
	 * @return bool
142
	 */
143
    public function __isset($name) {
144
        return array_key_exists($name,$this->_data)||parent::__isset($name);
145
    }
146
}
147