summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid T. Sadler <davidtsadler@googlemail.com>2021-11-13 08:30:24 +0000
committerDavid T. Sadler <davidtsadler@googlemail.com>2021-11-13 08:30:24 +0000
commit3ce11b937bd1c16113317a1e9c230c9813d62b4e (patch)
treefa4514e0fbf1dfdbc96131a220adbcbb5359e286 /src
parentb8ee7f12aba7a81fa0ffbc5cae68e576a2a2372b (diff)
Make title required
Diffstat (limited to 'src')
-rw-r--r--src/DTS/Validator.php4
-rw-r--r--src/templates/index.php2
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 } ?>