diff options
| author | David T. Sadler <davidtsadler@googlemail.com> | 2021-11-13 08:30:24 +0000 |
|---|---|---|
| committer | David T. Sadler <davidtsadler@googlemail.com> | 2021-11-13 08:30:24 +0000 |
| commit | 3ce11b937bd1c16113317a1e9c230c9813d62b4e (patch) | |
| tree | fa4514e0fbf1dfdbc96131a220adbcbb5359e286 /src | |
| parent | b8ee7f12aba7a81fa0ffbc5cae68e576a2a2372b (diff) | |
Make title required
Diffstat (limited to 'src')
| -rw-r--r-- | src/DTS/Validator.php | 4 | ||||
| -rw-r--r-- | src/templates/index.php | 2 |
2 files changed, 1 insertions, 5 deletions
diff --git a/src/DTS/Validator.php b/src/DTS/Validator.php index a688832..b4c85f7 100644 --- a/src/DTS/Validator.php +++ b/src/DTS/Validator.php @@ -47,10 +47,6 @@ class Validator { $title = trim($title); - if ($title === '') { - return; - } - if (strlen($title) < $minLength || strlen($title) > $maxLength) { $this->errors->add('title', "Must be between $minLength and $maxLength in characters in length"); } diff --git a/src/templates/index.php b/src/templates/index.php index 35dd7ad..d8f751f 100644 --- a/src/templates/index.php +++ b/src/templates/index.php @@ -26,7 +26,7 @@ <?php foreach ($bookmarks as $bookmark) { ?> <li> <a href="<?= htmlentities($bookmark->url); ?>"> - <?= (new DateTime($bookmark->addedAt))->format('Y-m-d'); ?> - <?= $bookmark->title != '' ? htmlentities($bookmark->title) : htmlentities($bookmark->url); ?></a> | <?php if ($bookmark->tag) { ?><a class="no-decoration tag" href="/?tag=<?= htmlentities($bookmark->tag); ?>"><?= htmlentities($bookmark->tag); ?></a> | <?php } ?><a class="no-decoration" href="/edit/?id=<?= $bookmark->id; ?>">Edit</a> | <a class="no-decoration" href="/delete/confirm/?id=<?= $bookmark->id; ?>">Delete + <?= (new DateTime($bookmark->addedAt))->format('Y-m-d'); ?> - <?= htmlentities($bookmark->title); ?></a> | <?php if ($bookmark->tag) { ?><a class="no-decoration tag" href="/?tag=<?= htmlentities($bookmark->tag); ?>"><?= htmlentities($bookmark->tag); ?></a> | <?php } ?><a class="no-decoration" href="/edit/?id=<?= $bookmark->id; ?>">Edit</a> | <a class="no-decoration" href="/delete/confirm/?id=<?= $bookmark->id; ?>">Delete </a> </li> <?php } ?> |
