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 | /* |
||
4 | * This file is part of Jitamin. |
||
5 | * |
||
6 | * Copyright (C) Jitamin Team |
||
7 | * |
||
8 | * For the full copyright and license information, please view the LICENSE |
||
9 | * file that was distributed with this source code. |
||
10 | */ |
||
11 | |||
12 | namespace Jitamin\Http\Controllers; |
||
13 | |||
14 | use DateTime; |
||
15 | use Jitamin\Foundation\Exceptions\AccessForbiddenException; |
||
16 | use PicoFeed\Syndication\AtomFeedBuilder; |
||
17 | use PicoFeed\Syndication\AtomItemBuilder; |
||
18 | use PicoFeed\Syndication\FeedBuilder; |
||
19 | |||
20 | /** |
||
21 | * Atom/RSS Feed controller. |
||
22 | */ |
||
23 | class FeedController extends Controller |
||
24 | { |
||
25 | /** |
||
26 | * RSS feed for a user. |
||
27 | */ |
||
28 | public function user() |
||
29 | { |
||
30 | $token = $this->request->getStringParam('token'); |
||
0 ignored issues
–
show
|
|||
31 | $user = $this->userModel->getByToken($token); |
||
0 ignored issues
–
show
The property
userModel does not exist on object<Jitamin\Http\Controllers\FeedController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
32 | |||
33 | // Token verification |
||
34 | if (empty($user)) { |
||
35 | throw AccessForbiddenException::getInstance()->withoutLayout(); |
||
36 | } |
||
37 | |||
38 | $events = $this->helper->projectActivity->getProjectsEvents($this->projectPermissionModel->getActiveProjectIds($user['id'])); |
||
0 ignored issues
–
show
The property
helper does not exist on object<Jitamin\Http\Controllers\FeedController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() The property
projectPermissionModel does not exist on object<Jitamin\Http\Controllers\FeedController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
39 | |||
40 | $feedBuilder = AtomFeedBuilder::create() |
||
41 | ->withTitle(l('Project activities for %s', $this->helper->user->getFullname($user))) |
||
0 ignored issues
–
show
The property
helper does not exist on object<Jitamin\Http\Controllers\FeedController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
42 | ->withFeedUrl($this->helper->url->to('FeedController', 'user', ['token' => $user['token']], '', true)) |
||
0 ignored issues
–
show
The property
helper does not exist on object<Jitamin\Http\Controllers\FeedController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
43 | ->withSiteUrl($this->helper->url->base()) |
||
0 ignored issues
–
show
The property
helper does not exist on object<Jitamin\Http\Controllers\FeedController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
44 | ->withDate(new DateTime()); |
||
45 | |||
46 | $this->response->xml($this->buildFeedItems($events, $feedBuilder)->build()); |
||
0 ignored issues
–
show
The property
response does not exist on object<Jitamin\Http\Controllers\FeedController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
47 | } |
||
48 | |||
49 | /** |
||
50 | * RSS feed for a project. |
||
51 | */ |
||
52 | public function project() |
||
53 | { |
||
54 | $token = $this->request->getStringParam('token'); |
||
0 ignored issues
–
show
The property
request does not exist on object<Jitamin\Http\Controllers\FeedController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
55 | $project = $this->projectModel->getByToken($token); |
||
0 ignored issues
–
show
The property
projectModel does not exist on object<Jitamin\Http\Controllers\FeedController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
56 | |||
57 | if (empty($project)) { |
||
58 | throw AccessForbiddenException::getInstance()->withoutLayout(); |
||
59 | } |
||
60 | |||
61 | $events = $this->helper->projectActivity->getProjectEvents($project['id']); |
||
0 ignored issues
–
show
The property
helper does not exist on object<Jitamin\Http\Controllers\FeedController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
62 | |||
63 | $feedBuilder = AtomFeedBuilder::create() |
||
64 | ->withTitle(l('%s\'s activity', $project['name'])) |
||
65 | ->withFeedUrl($this->helper->url->to('FeedController', 'project', ['token' => $project['token']], '', true)) |
||
0 ignored issues
–
show
The property
helper does not exist on object<Jitamin\Http\Controllers\FeedController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
66 | ->withSiteUrl($this->helper->url->base()) |
||
0 ignored issues
–
show
The property
helper does not exist on object<Jitamin\Http\Controllers\FeedController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
67 | ->withDate(new DateTime()); |
||
68 | |||
69 | $this->response->xml($this->buildFeedItems($events, $feedBuilder)->build()); |
||
0 ignored issues
–
show
The property
response does not exist on object<Jitamin\Http\Controllers\FeedController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
70 | } |
||
71 | |||
72 | /** |
||
73 | * Build feed items. |
||
74 | * |
||
75 | * @param array $events |
||
76 | * @param FeedBuilder $feedBuilder |
||
77 | * |
||
78 | * @return FeedBuilder |
||
79 | */ |
||
80 | protected function buildFeedItems(array $events, FeedBuilder $feedBuilder) |
||
81 | { |
||
82 | foreach ($events as $event) { |
||
83 | $itemDate = new DateTime(); |
||
84 | $itemDate->setTimestamp($event['date_creation']); |
||
85 | |||
86 | $itemUrl = $this->helper->url->to('Task/TaskController', 'show', ['task_id' => $event['task_id']], '', true); |
||
0 ignored issues
–
show
The property
helper does not exist on object<Jitamin\Http\Controllers\FeedController> . Since you implemented __get , maybe consider adding a @property annotation.
Since your code implements the magic getter <?php
/**
* @property int $x
* @property int $y
* @property string $text
*/
class MyLabel
{
private $properties;
private $allowedProperties = array('x', 'y', 'text');
public function __get($name)
{
if (isset($properties[$name]) && in_array($name, $this->allowedProperties)) {
return $properties[$name];
} else {
return null;
}
}
public function __set($name, $value)
{
if (in_array($name, $this->allowedProperties)) {
$properties[$name] = $value;
} else {
throw new \LogicException("Property $name is not defined.");
}
}
}
If the property has read access only, you can use the @property-read annotation instead. Of course, you may also just have mistyped another name, in which case you should fix the error. See also the PhpDoc documentation for @property. ![]() |
|||
87 | |||
88 | $feedBuilder |
||
89 | ->withItem(AtomItemBuilder::create($feedBuilder) |
||
90 | ->withTitle($event['event_title']) |
||
91 | ->withUrl($itemUrl.'#event-'.$event['id']) |
||
92 | ->withAuthor($event['author']) |
||
93 | ->withPublishedDate($itemDate) |
||
94 | ->withUpdatedDate($itemDate) |
||
95 | ->withContent($event['event_content']) |
||
96 | ); |
||
97 | } |
||
98 | |||
99 | return $feedBuilder; |
||
100 | } |
||
101 | } |
||
102 |
Since your code implements the magic getter
_get
, this function will be called for any read access on an undefined variable. You can add the@property
annotation to your class or interface to document the existence of this variable.If the property has read access only, you can use the @property-read annotation instead.
Of course, you may also just have mistyped another name, in which case you should fix the error.
See also the PhpDoc documentation for @property.