likely the last commit had a serious vulnerability. this is just a sync
Deploy vintagecoding.net / deploy (push) Canceled after 0s
Deploy vintagecoding.net / deploy (push) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
class Todo
|
||||
{
|
||||
private int $id;
|
||||
private int $space;
|
||||
private string $title;
|
||||
private ?string $description;
|
||||
private ?DateTime $due;
|
||||
private ?int $priority;
|
||||
private ?string $link;
|
||||
private DateTime $createdAt;
|
||||
|
||||
public function __construct(int $id, int $space, string $title, ?string $description, ?DateTime $due, ?int $priority, ?string $link, ?DateTime $createdAt)
|
||||
{
|
||||
if ($space < 0) {
|
||||
error_log('Tried creating a new space and todo at the same time.');
|
||||
return;
|
||||
}
|
||||
|
||||
$this->title = $title;
|
||||
$this->description = $description;
|
||||
$this->due = $due;
|
||||
$this->priority = $priority;
|
||||
$this->link = $link;
|
||||
$this->createdAt = $createdAt;
|
||||
|
||||
if ($id < 0) {
|
||||
$this->id = $id * -1;
|
||||
$stmt = 'INSERT INTO todo (id, space, title, description, due, priority, link) VALUES (?, ?, ?, ?, ?, ?, ?)';
|
||||
exec_stmt($stmt, 'iisssiss', $this->id, $space, $title, $description, $due, $priority, $link);
|
||||
} else
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
public function getHTML()
|
||||
{
|
||||
$html = '
|
||||
<div class="row">
|
||||
<label class="form_checkbox_container">' . $this->title . '
|
||||
<span class="checkmark"></span>
|
||||
</label>
|
||||
</div>
|
||||
';
|
||||
|
||||
return $html;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user