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/TbEditableColumn.php (4 issues)

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
 * TbEditableColumn 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.TbEditable');
12
Yii::import('booster.widgets.TbEditableField');
13
Yii::import('zii.widgets.grid.CDataColumn');
14
15
/**
16
 * TbEditableColumn widget makes editable one column in CGridView.
17
 *
18
 * @package widgets
19
 */
20
class TbEditableColumn extends TbDataColumn
21
{
22
    /**
23
    * @var array editable config options.
24
    * @see TbEditableField config
25
    */
26
    public $editable = array();
27
    
28
    protected function fetchKeys($dataProvider) {
29
    	$keys = array();
30
    	$data = $dataProvider->getData();
31
    	if(isset($data) && !empty($data))
32
    	foreach($data[0] as $i=>$data)
33
    		$keys[]=$i;
34
    	return $keys;
35
    }
36
37
    public function init()
38
    {
39
        if (!$this->name) {
40
            throw new CException('You should provide name for TbEditableColumn');
41
        }
42
43
        parent::init();
44
		
45
        /**
46
         * add a dummy object to the data provider and call render function to allow register 
47
         * required scripts if grid was initially empty...
48
         */
49
        if(empty($this->grid->dataProvider->data)) {
50
	        if ($this->grid->dataProvider instanceof CActiveDataProvider)
0 ignored issues
show
The class CActiveDataProvider 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...
51
	        	$dummy = new $this->grid->dataProvider->modelClass();
52
			else if ($this->grid->dataProvider instanceof CArrayDataProvider) {
0 ignored issues
show
The class CArrayDataProvider 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...
53
				$keys = $this->fetchKeys($this->grid->dataProvider);
54
				$dummy = array();
55
				foreach ($keys as $key) {
56
					$dummy[$key] = $key; // anyvalue;
57
				}
58
			} else {
59
				$dummy = null;			
60
			}
61
			$this->grid->dataProvider->data = array($dummy);
62
			$this->editable['htmlOptions'] = array('style' => 'display: none;');
63
	        $this->renderDataCellContent(0, $dummy); // this is the target line
64
	        $this->grid->dataProvider->data = array();
65
        }
66
        //need to attach ajaxUpdate handler to refresh editables on pagination and sort
67
        TbEditable::attachAjaxUpdateEvent($this->grid);
68
    }
69
   
70
    //protected was removed due to https://github.com/vitalets/x-editable-yii/issues/63
71
    public function renderDataCellContent($row, $data)
72
    {
73
        $isModel = $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...
74
        
75
        if($isModel) {
76
            $widgetClass = 'TbEditableField';
77
            $options = array(
78
                'model'        => $data,
79
                'attribute'    => empty($this->editable['attribute']) ? $this->name : $this->editable['attribute'],
80
            );
81
            
82
            //if value defined in column config --> we should evaluate it 
83
            //and pass to widget via `text` option: set flag `passText` = true 
84
            $passText = !empty($this->value);     
85
        } else {
86
            $widgetClass = 'TbEditable';
87
            $options = array(
88
                'pk'           => $data[$this->grid->dataProvider->keyField],
89
                'name'         => empty($this->editable['name']) ? $this->name : $this->editable['name'],
90
            );
91
            
92
            $passText = true;
93
            //if autotext will be applied, do not pass `text` option (pass `value` instead)
94
            if(empty($this->value) && TbEditable::isAutotext($this->editable, isset($this->editable['type']) ? $this->editable['type'] : '')) {
95
               $options['value'] = $data[$this->name]; 
96
               $passText = false;
97
            } 
98
        }
99
        
100
        //for live update
101
        $options['liveTarget'] = $this->grid->id;
102
        
103
        $options = CMap::mergeArray($this->editable, $options);
104
105
        //if value defined for column --> use it as element text
106
        if($passText) {
107
            ob_start();
108
            parent::renderDataCellContent($row, $data);
109
            $text = ob_get_clean();
110
            $options['text'] = $text;
111
            $options['encode'] = false;
112
        }
113
        
114
        //apply may be a string expression, see https://github.com/vitalets/x-editable-yii/issues/33
115
        if (isset($options['apply']) && is_string($options['apply'])) {
116
            $options['apply'] = $this->evaluateExpression($options['apply'], array('data'=>$data, 'row'=>$row));
117
        }
118
119
        //evaluate htmlOptions inside editable config as they can depend on $data
120
        //see https://github.com/vitalets/x-editable-yii/issues/40
121
        if (isset($options['htmlOptions']) && is_array($options['htmlOptions'])) {
122
            foreach($options['htmlOptions'] as $k => $v) {
123
                if(is_string($v) && (strpos($v, '$data') !== false || strpos($v, '$row') !== false)) {
124
                    $options['htmlOptions'][$k] = $this->evaluateExpression($v, array('data'=>$data, 'row'=>$row));
125
                }
126
            }
127
        }           
128
        
129
        $this->grid->controller->widget($widgetClass, $options);
130
    }
131
    
132
    /*
133
    Require this overwrite to show bootstrap sort icons
134
    */
135
    protected function renderHeaderCellContent()
136
    {
137
        /* TODO 
138
         if(yii::app()->editable->form != 'bootstrap') {
139
            parent::renderHeaderCellContent();
140
            return;
141
        } */
142
        
143
        if ($this->grid->enableSorting && $this->sortable && $this->name !== null)
144
        {
145
            $sort = $this->grid->dataProvider->getSort();
146
            $label = isset($this->header) ? $this->header : $sort->resolveLabel($this->name);
147
148
            if ($sort->resolveAttribute($this->name) !== false)
149
                $label .= '<span class="caret"></span>';
150
151
            echo $sort->link($this->name, $label, array('class'=>'sort-link'));
152
        }
153
        else
154
        {
155
            if ($this->name !== null && $this->header === null)
156
            {
157
                if ($this->grid->dataProvider instanceof CActiveDataProvider)
0 ignored issues
show
The class CActiveDataProvider 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...
158
                    echo CHtml::encode($this->grid->dataProvider->model->getAttributeLabel($this->name));
159
                else
160
                    echo CHtml::encode($this->name);
161
            }
162
            else
163
                parent::renderHeaderCellContent();
164
        }
165
    } 
166
    
167
    /*
168
    Require this overwrite to show bootstrap filter field
169
    */    
170
    public function renderFilterCell()
171
    {
172
        /* TODO
173
        if(yii::app()->editable->form != 'bootstrap') {
174
            parent::renderFilterCell();
175
            return;
176
        } */
177
                
178
        parent::renderFilterCell();
179
    }       
180
}
181