This project does not seem to handle request data directly as such no vulnerable execution paths were found.
include
, or for example
via PHP's auto-loading mechanism.
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 Oro\Bundle\EmailBundle\Controller\Api\Rest; |
||
4 | |||
5 | use FOS\RestBundle\Controller\Annotations\NamePrefix; |
||
6 | use FOS\RestBundle\Controller\Annotations\RouteResource; |
||
7 | use FOS\RestBundle\Controller\Annotations\QueryParam; |
||
8 | use FOS\RestBundle\Controller\Annotations\Get; |
||
9 | use FOS\RestBundle\Controller\Annotations\Delete; |
||
10 | |||
11 | use Nelmio\ApiDocBundle\Annotation\ApiDoc; |
||
12 | |||
13 | use Symfony\Component\HttpFoundation\Response; |
||
14 | |||
15 | use Oro\Bundle\SecurityBundle\Annotation\AclAncestor; |
||
16 | use Oro\Bundle\SoapBundle\Controller\Api\Rest\RestController; |
||
17 | use Oro\Bundle\SoapBundle\Request\Parameters\Filter\StringToArrayParameterFilter; |
||
18 | use Oro\Bundle\EmailBundle\Entity\Manager\EmailApiEntityManager; |
||
19 | use Oro\Bundle\EmailBundle\Entity\Email; |
||
20 | use Oro\Bundle\EmailBundle\Cache\EmailCacheManager; |
||
21 | |||
22 | /** |
||
23 | * @RouteResource("email") |
||
24 | * @NamePrefix("oro_api_") |
||
25 | */ |
||
26 | class EmailController extends RestController |
||
27 | { |
||
28 | /** |
||
29 | * Get emails. |
||
30 | * |
||
31 | * @QueryParam( |
||
32 | * name="page", |
||
33 | * requirements="\d+", |
||
34 | * nullable=true, |
||
35 | * description="Page number, starting from 1. Defaults to 1." |
||
36 | * ) |
||
37 | * @QueryParam( |
||
38 | * name="limit", |
||
39 | * requirements="\d+", |
||
40 | * nullable=true, |
||
41 | * description="Number of items per page. Defaults to 10." |
||
42 | * ) |
||
43 | * @QueryParam( |
||
44 | * name="messageId", |
||
45 | * requirements=".+", |
||
46 | * nullable=true, |
||
47 | * description="The email 'Message-ID' attribute. One or several message ids separated by comma." |
||
48 | * ) |
||
49 | * @ApiDoc( |
||
50 | * description="Get emails", |
||
51 | * resource=true |
||
52 | * ) |
||
53 | * @AclAncestor("oro_email_email_view") |
||
54 | * @return Response |
||
55 | */ |
||
56 | public function cgetAction() |
||
57 | { |
||
58 | $page = (int)$this->getRequest()->get('page', 1); |
||
59 | $limit = (int)$this->getRequest()->get('limit', self::ITEMS_PER_PAGE); |
||
60 | |||
61 | $filterParameters = [ |
||
62 | 'messageId' => new StringToArrayParameterFilter() |
||
63 | ]; |
||
64 | $criteria = $this->getFilterCriteria( |
||
65 | $this->getSupportedQueryParameters(__FUNCTION__), |
||
66 | $filterParameters |
||
67 | ); |
||
68 | |||
69 | return $this->handleGetListRequest($page, $limit, $criteria); |
||
0 ignored issues
–
show
|
|||
70 | } |
||
71 | |||
72 | /** |
||
73 | * Get email. |
||
74 | * |
||
75 | * @param string $id |
||
76 | * |
||
77 | * @Get("/emails/{id}", requirements={"id"="\d+"}) |
||
78 | * |
||
79 | * @ApiDoc( |
||
80 | * description="Get email", |
||
81 | * resource=true |
||
82 | * ) |
||
83 | * @AclAncestor("oro_email_email_view") |
||
84 | * @return Response |
||
85 | */ |
||
86 | public function getAction($id) |
||
87 | { |
||
88 | return $this->handleGetRequest($id); |
||
89 | } |
||
90 | |||
91 | /** |
||
92 | * Update email. |
||
93 | * |
||
94 | * @param int $id The id of the email |
||
95 | * |
||
96 | * @ApiDoc( |
||
97 | * description="Update email", |
||
98 | * resource=true |
||
99 | * ) |
||
100 | * @AclAncestor("oro_email_email_user_edit") |
||
101 | * @return Response |
||
102 | */ |
||
103 | public function putAction($id) |
||
104 | { |
||
105 | return $this->handleUpdateRequest($id); |
||
106 | } |
||
107 | |||
108 | /** |
||
109 | * Create new email. |
||
110 | * |
||
111 | * @ApiDoc( |
||
112 | * description="Create new email", |
||
113 | * resource=true |
||
114 | * ) |
||
115 | * @AclAncestor("oro_email_email_user_edit") |
||
116 | */ |
||
117 | public function postAction() |
||
118 | { |
||
119 | return $this->handleCreateRequest(); |
||
120 | } |
||
121 | |||
122 | /** |
||
123 | * Get email cache manager |
||
124 | * |
||
125 | * @return EmailCacheManager |
||
126 | */ |
||
127 | protected function getEmailCacheManager() |
||
128 | { |
||
129 | return $this->container->get('oro_email.email.cache.manager'); |
||
130 | } |
||
131 | |||
132 | /** |
||
133 | * Get entity manager |
||
134 | * |
||
135 | * @return EmailApiEntityManager |
||
136 | */ |
||
137 | public function getManager() |
||
138 | { |
||
139 | return $this->container->get('oro_email.manager.email.api'); |
||
140 | } |
||
141 | |||
142 | /** |
||
143 | * {@inheritdoc} |
||
144 | */ |
||
145 | public function getForm() |
||
146 | { |
||
147 | return $this->get('oro_email.form.email.api'); |
||
148 | } |
||
149 | |||
150 | /** |
||
151 | * {@inheritdoc} |
||
152 | */ |
||
153 | public function getFormHandler() |
||
154 | { |
||
155 | return $this->get('oro_email.form.handler.email.api'); |
||
156 | } |
||
157 | |||
158 | /** |
||
159 | * @param string $attribute |
||
160 | * @param Email $email |
||
161 | * |
||
162 | * @return bool |
||
163 | */ |
||
164 | protected function assertEmailAccessGranted($attribute, Email $email) |
||
165 | { |
||
166 | return $this->get('oro_security.security_facade')->isGranted($attribute, $email); |
||
167 | } |
||
168 | } |
||
169 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: