wernerkrauss /
silverstripe-homepage
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 | * Created by IntelliJ IDEA. |
||
| 4 | * User: Werner M. Krauß <[email protected]> |
||
| 5 | * Date: 28.10.2015 |
||
| 6 | * Time: 12:02 |
||
| 7 | */ |
||
| 8 | |||
| 9 | /** |
||
| 10 | * StartGeneratedWithDataObjectAnnotator |
||
| 11 | * @property string Title |
||
| 12 | * @property string Content |
||
| 13 | * @property string LinkText |
||
| 14 | * @property string ExternalLinkURL |
||
| 15 | * @property boolean IsActive |
||
| 16 | * @property int SortOrder |
||
| 17 | * @property int HomePageID |
||
| 18 | * @property int LinkToPageID |
||
| 19 | * @method HomePage HomePage |
||
| 20 | * @method Page LinkToPage |
||
| 21 | * EndGeneratedWithDataObjectAnnotator |
||
| 22 | */ |
||
| 23 | class HomePageBlock extends DataObject |
||
|
0 ignored issues
–
show
|
|||
| 24 | { |
||
| 25 | |||
| 26 | private static $db = [ |
||
|
0 ignored issues
–
show
|
|||
| 27 | 'Title' => 'Varchar(64)', |
||
| 28 | 'Content' => 'HTMLText', |
||
| 29 | 'LinkText' => 'Varchar(64)', |
||
| 30 | 'ExternalLinkURL' => 'Varchar(255)', |
||
| 31 | 'IsActive' => 'Boolean', |
||
| 32 | 'SortOrder' => 'Int' |
||
| 33 | ]; |
||
| 34 | |||
| 35 | private static $has_one = [ |
||
|
0 ignored issues
–
show
|
|||
| 36 | 'HomePage' => 'HomePage', |
||
| 37 | 'LinkToPage' => 'Page' |
||
| 38 | ]; |
||
| 39 | |||
| 40 | private static $singular_name = 'Home page block'; |
||
|
0 ignored issues
–
show
|
|||
| 41 | |||
| 42 | private static $plural_name = 'Home page blocks'; |
||
|
0 ignored issues
–
show
|
|||
| 43 | |||
| 44 | private static $summary_fields = [ |
||
|
0 ignored issues
–
show
|
|||
| 45 | 'Title', 'IsActive' |
||
| 46 | ]; |
||
| 47 | |||
| 48 | private static $default_sort = 'SortOrder'; |
||
|
0 ignored issues
–
show
|
|||
| 49 | |||
| 50 | /** |
||
| 51 | * for configuring fluent |
||
| 52 | * @var array |
||
| 53 | */ |
||
| 54 | private static $translate = [ |
||
|
0 ignored issues
–
show
|
|||
| 55 | 'Title', |
||
| 56 | 'Content', |
||
| 57 | 'LinkText', |
||
| 58 | 'ExternalLinkURL' |
||
| 59 | ]; |
||
| 60 | |||
| 61 | public function getCMSFields() |
||
|
0 ignored issues
–
show
The return type could not be reliably inferred; please add a
@return annotation.
Our type inference engine in quite powerful, but sometimes the code does not
provide enough clues to go by. In these cases we request you to add a Loading history...
|
|||
| 62 | { |
||
| 63 | $fields = parent::getCMSFields(); |
||
| 64 | |||
| 65 | $linkTo = $fields->dataFieldByName('LinkToPageID')->setEmptyString('-- bitte auswählen --'); |
||
| 66 | |||
| 67 | $fields->removeByName(['SortOrder', 'HomePageID', 'LinkToPageID']); |
||
| 68 | |||
| 69 | $fields->insertAfter('LinkText', $linkTo); |
||
| 70 | |||
| 71 | $this->extend('updateCMSFields', $fields); |
||
| 72 | |||
| 73 | return $fields; |
||
| 74 | } |
||
| 75 | |||
| 76 | public function getLink() |
||
|
0 ignored issues
–
show
The return type could not be reliably inferred; please add a
@return annotation.
Our type inference engine in quite powerful, but sometimes the code does not
provide enough clues to go by. In these cases we request you to add a Loading history...
|
|||
| 77 | { |
||
| 78 | $link = $this->LinkToPageID && $this->LinkToPage() |
||
|
0 ignored issues
–
show
The method
LinkToPage does not exist on object<HomePageBlock>? Since you implemented __call, maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
Loading history...
|
|||
| 79 | ? $this->LinkToPage()->Link() |
||
|
0 ignored issues
–
show
The method
LinkToPage does not exist on object<HomePageBlock>? Since you implemented __call, maybe consider adding a @method annotation.
If you implement This is often the case, when class ParentClass {
private $data = array();
public function __call($method, array $args) {
if (0 === strpos($method, 'get')) {
return $this->data[strtolower(substr($method, 3))];
}
throw new \LogicException(sprintf('Unsupported method: %s', $method));
}
}
/**
* If this class knows which fields exist, you can specify the methods here:
*
* @method string getName()
*/
class SomeClass extends ParentClass { }
Loading history...
|
|||
| 80 | : $this->ExternalLinkURL; |
||
| 81 | |||
| 82 | $this->extend('updateLink', $link); |
||
| 83 | |||
| 84 | return $link; |
||
| 85 | } |
||
| 86 | } |
||
| 87 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.