Firesphere /
silverstripe-stripeslack
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.
| 1 | <?php |
||||
| 2 | |||||
| 3 | /** |
||||
| 4 | * class GridfieldInviteResendAction adds the resend button to the CMS for easy re-inviting |
||||
| 5 | */ |
||||
| 6 | class GridfieldInviteResendAction implements GridField_ColumnProvider, GridField_ActionProvider |
||||
|
0 ignored issues
–
show
The type
GridField_ActionProvider was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||||
| 7 | { |
||||
| 8 | |||||
| 9 | /** |
||||
| 10 | * @param GridField $gridField |
||||
| 11 | * @param array $columns |
||||
| 12 | */ |
||||
| 13 | public function augmentColumns($gridField, &$columns) |
||||
| 14 | { |
||||
| 15 | if (!in_array('Actions', $columns, true)) { |
||||
| 16 | $columns[] = 'Actions'; |
||||
| 17 | } |
||||
| 18 | } |
||||
| 19 | |||||
| 20 | /** |
||||
| 21 | * {@inheritDoc} |
||||
| 22 | */ |
||||
| 23 | public function getColumnAttributes($gridField, $record, $columnName) |
||||
| 24 | { |
||||
| 25 | return array('class' => 'col-buttons'); |
||||
| 26 | } |
||||
| 27 | |||||
| 28 | /** |
||||
| 29 | * {@inheritDoc} |
||||
| 30 | */ |
||||
| 31 | public function getColumnMetadata($gridField, $columnName) |
||||
| 32 | { |
||||
| 33 | if ($columnName === 'Actions') { |
||||
| 34 | return array('title' => ''); |
||||
| 35 | } |
||||
| 36 | } |
||||
| 37 | |||||
| 38 | /** |
||||
| 39 | * {@inheritDoc} |
||||
| 40 | */ |
||||
| 41 | public function getColumnsHandled($gridField) |
||||
| 42 | { |
||||
| 43 | return array('Actions'); |
||||
| 44 | } |
||||
| 45 | |||||
| 46 | /** |
||||
| 47 | * @param GridField $gridField |
||||
| 48 | * @param SlackInvite $record |
||||
| 49 | * @param string $columnName |
||||
| 50 | * @return HTMLText |
||||
|
0 ignored issues
–
show
The type
HTMLText was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||||
| 51 | */ |
||||
| 52 | public function getColumnContent($gridField, $record, $columnName) |
||||
| 53 | { |
||||
| 54 | $config = SiteConfig::current_site_config(); |
||||
|
0 ignored issues
–
show
The type
SiteConfig was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||||
| 55 | // No point in showing the re-send button, if there's no token |
||||
| 56 | if ($config->SlackToken) { |
||||
| 57 | if (!$record->Invited) { |
||||
| 58 | $field = GridField_FormAction::create( |
||||
|
0 ignored issues
–
show
The type
GridField_FormAction was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||||
| 59 | $gridField, |
||||
| 60 | 'Retry' . $record->ID, |
||||
| 61 | false, |
||||
| 62 | 'resend', |
||||
| 63 | ['RecordID' => $record->ID] |
||||
| 64 | ) |
||||
| 65 | ->addExtraClass('gridfield-button-resend') |
||||
| 66 | ->setAttribute('title', 'Retry invite') |
||||
| 67 | ->setAttribute('data-icon', 'arrow-circle-135-left') |
||||
| 68 | ->setDescription(_t('GridfieldInviteResendAction.Resend', 'Retry failed invitation')); |
||||
|
0 ignored issues
–
show
The function
_t was not found. Maybe you did not declare it correctly or list all dependencies?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 69 | } else { |
||||
| 70 | $field = GridField_FormAction::create( |
||||
| 71 | $gridField, |
||||
| 72 | 'Resend', |
||||
| 73 | false, |
||||
| 74 | 'resend', |
||||
| 75 | ['RecordID' => $record->ID] |
||||
| 76 | ) |
||||
| 77 | ->addExtraClass('gridfield-button-resend') |
||||
| 78 | ->setAttribute('title', 'Resend invite') |
||||
| 79 | ->setAttribute('data-icon', 'arrow-circle-double') |
||||
| 80 | ->setDescription('Resend invite'); |
||||
| 81 | } |
||||
| 82 | |||||
| 83 | return $field->Field(); |
||||
| 84 | } |
||||
| 85 | } |
||||
| 86 | |||||
| 87 | /** |
||||
| 88 | * {@inheritDoc} |
||||
| 89 | */ |
||||
| 90 | public function getActions($gridField) |
||||
| 91 | { |
||||
| 92 | return array('resend'); |
||||
| 93 | } |
||||
| 94 | |||||
| 95 | /** |
||||
| 96 | * @param GridField $gridField |
||||
| 97 | * @param $actionName |
||||
| 98 | * @param $arguments |
||||
| 99 | * @param $data |
||||
| 100 | * @throws \ValidationException |
||||
| 101 | */ |
||||
| 102 | public function handleAction(GridField $gridField, $actionName, $arguments, $data) |
||||
| 103 | { |
||||
| 104 | if ($actionName === 'resend') { |
||||
| 105 | /** @var SlackInvite $item */ |
||||
| 106 | $item = SlackInvite::get()->byID($arguments['RecordID']); |
||||
| 107 | if (!$item) { |
||||
| 108 | return; |
||||
| 109 | } |
||||
| 110 | |||||
| 111 | $result = $item->resendInvite(); |
||||
|
0 ignored issues
–
show
Are you sure the assignment to
$result is correct as $item->resendInvite() targeting SlackInvite::resendInvite() seems to always return null.
This check looks for function or method calls that always return null and whose return value is assigned to a variable. class A
{
function getObject()
{
return null;
}
}
$a = new A();
$object = $a->getObject();
The method The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes. Loading history...
|
|||||
| 112 | if ($result === true) { |
||||
| 113 | Controller::curr()->getResponse()->setStatusCode( |
||||
|
0 ignored issues
–
show
The type
Controller was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||||
| 114 | 200, |
||||
| 115 | 'User successfully invited.' |
||||
| 116 | ); |
||||
| 117 | } else { |
||||
| 118 | Controller::curr()->getResponse()->setStatusCode( |
||||
| 119 | 200, |
||||
| 120 | $result |
||||
| 121 | ); |
||||
| 122 | } |
||||
| 123 | } |
||||
| 124 | } |
||||
| 125 | } |
||||
| 126 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths