Issues (46)

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.

lib/Trello/Api/Card/Checklists.php (1 issue)

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 Trello\Api\Card;
4
5
use Trello\Api\AbstractApi;
6
use Trello\Exception\MissingArgumentException;
7
8
/**
9
 * Trello Card Checklists API
10
 * @link https://trello.com/docs/api/card
11
 *
12
 * Fully implemented.
13
 */
14
class Checklists extends AbstractApi
15
{
16
    protected $path = 'cards/#id#/checklists';
17
18
    /**
19
     * Get checklists related to a given card
20
     * @link https://trello.com/docs/api/card/#get-1-cards-card-id-or-shortlink-checklists
21
     *
22
     * @param string $id     the card's id or short link
23
     * @param array  $params optional parameters
24
     *
25
     * @return array
26
     */
27 1
    public function all($id, array $params = array())
28
    {
29 1
        return $this->get('cards/'.rawurlencode($id).'/checklists', $params);
30
    }
31
32
    /**
33
     * Add a checklist to a given card
34
     * @link https://trello.com/docs/api/card/#post-1-cards-card-id-or-shortlink-checklists
35
     *
36
     * @param string $id     the card's id or short link
37
     * @param array  $params All parameters are optional, but at least one has to be provided:
38
     *                       - value : id of the checklist to add, or null to create a new one.
39
     *                       - name : the checklist's name
40
     *                       - idChecklistSource : id of the source checklist to copy
41
     *
42
     * @return array
43
     *
44
     * @throws MissingArgumentException If there is not at least of the
45
     *                                  following parameters: 'value', 'name', 'idChecklistSource'
46
     */
47 2 View Code Duplication
    public function create($id, array $params)
0 ignored issues
show
This method seems to be duplicated in 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...
48
    {
49 2
        $atLeastOneOf = array('value', 'name', 'idChecklistSource');
50 2
        $this->validateAtLeastOneOf($atLeastOneOf, $params);
51
52 1
        return $this->post($this->getPath($id), $params);
53
    }
54
55
    /**
56
     * Remove a given checklist from a given card
57
     * @link https://trello.com/docs/api/card/#delete-1-cards-card-id-or-shortlink-checklists-idchecklist
58
     *
59
     * @param string $id          the card's id or short link
60
     * @param string $checklistId the checklist's id
61
     *
62
     * @return array
63
     */
64 1
    public function remove($id, $checklistId)
65
    {
66 1
        return $this->delete($this->getPath($id).'/'.rawurlencode($checklistId));
67
    }
68
69
    /**
70
     * Get a given card's checklist item states
71
     * @link https://trello.com/docs/api/card/#get-1-cards-card-id-or-shortlink-checkitemstates
72
     *
73
     * @param string $id          the card's id or short link
74
     *
75
     * @return array
76
     */
77 1
    public function itemStates($id, array $params = array())
78
    {
79 1
        return $this->get('cards/'.rawurlencode($id).'/checkItemStates', $params);
80
    }
81
82
    /**
83
     * Update a given check item
84
     * @link https://trello.com/docs/api/card/#put-1-cards-card-id-or-shortlink-checklist-idchecklistcurrent-checkitem-idcheckitem
85
     *
86
     * @param string $id          the card's id or short link
87
     * @param string $checklistId the checklist's id
88
     * @param string $checkItemId the check item's id
89
     * @param array  $data        check item data
90
     *
91
     * @return array
92
     */
93 1
    public function updateItem($id, $checklistId, $checkItemId, array $data)
94
    {
95 1
        return $this->put(
96 1
            $this->getPath($id).'/'.rawurlencode($checklistId).'/checkItem/'.rawurlencode($checkItemId),
97
            $data
98 1
        );
99
    }
100
101
    /**
102
     * Create a check item
103
     * @link https://trello.com/docs/api/card/#post-1-cards-card-id-or-shortlink-checklist-idchecklist-checkitem
104
     *
105
     * @param string $id          the card's id or short link
106
     * @param string $checklistId the checklist's id
107
     * @param string $name        check item name
108
     * @param array  $data        check item data
109
     *
110
     * @return array
111
     */
112 1
    public function createItem($id, $checklistId, $name, array $data = array())
113
    {
114 1
        $data['idChecklist'] = $checklistId;
115 1
        $data['name'] = $name;
116
117 1
        return $this->post($this->getPath($id).'/'.rawurlencode($checklistId).'/checkItem', $data);
118
    }
119
120
    /**
121
     * Convert a check item to card
122
     * @link https://trello.com/docs/api/card/#post-1-cards-card-id-or-shortlink-checklist-idchecklist-checkitem
123
     *
124
     * @param string $id          the card's id or short link
125
     * @param string $checklistId the checklist's id
126
     * @param string $checkItemId the check item's id
127
     *
128
     * @return array
129
     */
130 1
    public function convertItemToCard($id, $checklistId, $checkItemId)
131
    {
132 1
        return $this->post(
133 1
            $this->getPath($id).'/'.rawurlencode($checklistId).'/checkItem/'.rawurlencode($checkItemId).'/convertToCard'
134 1
        );
135
    }
136
137
    /**
138
     * Remove a check item from card
139
     * @link https://trello.com/docs/api/card/#post-1-cards-card-id-or-shortlink-checklist-idchecklist-checkitem
140
     *
141
     * @param string $id          the card's id or short link
142
     * @param string $checklistId the checklist's id
143
     * @param string $checkItemId the check item's id
144
     *
145
     * @return array
146
     */
147 1
    public function removeItem($id, $checklistId, $checkItemId)
148
    {
149 1
        return $this->delete(
150 1
            $this->getPath($id).'/'.rawurlencode($checklistId).'/checkItem/'.rawurlencode($checkItemId)
151 1
        );
152
    }
153
}
154