sunnysideup /
silverstripe-downloadtoemail
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 | /** |
||
| 5 | * record of all the |
||
| 6 | * |
||
| 7 | */ |
||
| 8 | class EmailDownloadPage_Registration extends DataObject |
||
|
0 ignored issues
–
show
|
|||
| 9 | { |
||
| 10 | private static $db = array( |
||
|
0 ignored issues
–
show
|
|||
| 11 | "Email" => "Varchar", |
||
| 12 | "Code" => "Varchar", |
||
| 13 | "Used" => "Boolean", |
||
| 14 | "DownloadTimes" => "Int" |
||
| 15 | ); |
||
| 16 | |||
| 17 | private static $has_one = array( |
||
|
0 ignored issues
–
show
|
|||
| 18 | "DownloadFile" => "File", |
||
| 19 | "EmailDownloadPage" => "EmailDownloadPage" |
||
| 20 | ); |
||
| 21 | |||
| 22 | private static $casting = array( |
||
|
0 ignored issues
–
show
|
|||
| 23 | "Title" => "Varchar", |
||
| 24 | "UsedNice" => "Varchar" |
||
| 25 | ); |
||
| 26 | |||
| 27 | private static $summary_fields = array( |
||
|
0 ignored issues
–
show
|
|||
| 28 | "Created" => "Sent", |
||
| 29 | "Email" => "Email", |
||
| 30 | "UsedNice" => "Download Link Has Been Used", |
||
| 31 | "DownloadTimes" => "Times Downloaded" |
||
| 32 | ); |
||
| 33 | |||
| 34 | private static $searchable_fields = array( |
||
|
0 ignored issues
–
show
|
|||
| 35 | "Email", |
||
| 36 | "UsedNice" |
||
| 37 | ); |
||
| 38 | |||
| 39 | /** |
||
| 40 | * standard SS method |
||
| 41 | * @param Member $member |
||
|
0 ignored issues
–
show
Should the type for parameter
$member not be Member|null?
This check looks for It makes a suggestion as to what type it considers more descriptive. Most often this is a case of a parameter that can be null in addition to its declared types. Loading history...
|
|||
| 42 | * @return Boolean |
||
| 43 | */ |
||
| 44 | public function canCreate($member = null) |
||
| 45 | { |
||
| 46 | return false; |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * standard SS method |
||
| 51 | * @param Member $member |
||
|
0 ignored issues
–
show
Should the type for parameter
$member not be Member|null?
This check looks for It makes a suggestion as to what type it considers more descriptive. Most often this is a case of a parameter that can be null in addition to its declared types. Loading history...
|
|||
| 52 | * @return Boolean |
||
| 53 | */ |
||
| 54 | public function canDelete($member = null) |
||
| 55 | { |
||
| 56 | return false; |
||
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * standard SS method |
||
| 61 | * @param Member $member |
||
|
0 ignored issues
–
show
Should the type for parameter
$member not be Member|null?
This check looks for It makes a suggestion as to what type it considers more descriptive. Most often this is a case of a parameter that can be null in addition to its declared types. Loading history...
|
|||
| 62 | * @return Boolean |
||
| 63 | */ |
||
| 64 | public function canEdit($member = null) |
||
| 65 | { |
||
| 66 | return false; |
||
| 67 | } |
||
| 68 | |||
| 69 | /** |
||
| 70 | * casted variable |
||
| 71 | * @return String |
||
| 72 | */ |
||
| 73 | public function getTitle() |
||
| 74 | { |
||
| 75 | return "Download for ".$this->Email; |
||
|
0 ignored issues
–
show
The property
Email does not exist on object<EmailDownloadPage_Registration>. 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. Loading history...
|
|||
| 76 | } |
||
| 77 | |||
| 78 | /** |
||
| 79 | * casted variable |
||
| 80 | * @return String |
||
| 81 | */ |
||
| 82 | public function getUsedNice() |
||
| 83 | { |
||
| 84 | return $this->dbObject('Used')->Nice(); |
||
| 85 | } |
||
| 86 | |||
| 87 | /** |
||
| 88 | * default sort |
||
| 89 | * @var String |
||
| 90 | */ |
||
| 91 | private static $default_sort = "\"Created\" DESC"; |
||
|
0 ignored issues
–
show
|
|||
| 92 | |||
| 93 | /** |
||
| 94 | * Automatically set Code |
||
| 95 | */ |
||
| 96 | public function onBeforeWrite() |
||
| 97 | { |
||
| 98 | parent::onBeforeWrite(); |
||
| 99 | if (!$this->Code) { |
||
|
0 ignored issues
–
show
The property
Code does not exist on object<EmailDownloadPage_Registration>. 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. Loading history...
|
|||
| 100 | $this->Code = md5(rand(0, 10000)); |
||
|
0 ignored issues
–
show
The property
Code does not exist on object<EmailDownloadPage_Registration>. Since you implemented __set, maybe consider adding a @property annotation.
Since your code implements the magic setter <?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.");
}
}
}
Since the property has write access only, you can use the @property-write 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. Loading history...
|
|||
| 101 | } |
||
| 102 | } |
||
| 103 | } |
||
| 104 |
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.