X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2Fbookmark%2FBookmark.php;h=4238ef259a8938eacaba721d6ca92e9cac6d54ae;hb=055d97f9a9e67d8ee8ae81bbf59a4b846a145d9f;hp=8aaeb9d87c504095405b78c7fdc6833d54e167d1;hpb=8affa2243159052675da7e23b737c76f6b43aeed;p=github%2Fshaarli%2FShaarli.git diff --git a/application/bookmark/Bookmark.php b/application/bookmark/Bookmark.php index 8aaeb9d8..4238ef25 100644 --- a/application/bookmark/Bookmark.php +++ b/application/bookmark/Bookmark.php @@ -19,7 +19,7 @@ use Shaarli\Bookmark\Exception\InvalidBookmarkException; class Bookmark { /** @var string Date format used in string (former ID format) */ - const LINK_DATE_FORMAT = 'Ymd_His'; + public const LINK_DATE_FORMAT = 'Ymd_His'; /** @var int Bookmark ID */ protected $id; @@ -106,7 +106,8 @@ class Bookmark */ public function validate(): void { - if ($this->id === null + if ( + $this->id === null || ! is_int($this->id) || empty($this->shortUrl) || empty($this->created) @@ -114,7 +115,7 @@ class Bookmark throw new InvalidBookmarkException($this); } if (empty($this->url)) { - $this->url = '/shaare/'. $this->shortUrl; + $this->url = '/shaare/' . $this->shortUrl; } if (empty($this->title)) { $this->title = $this->url;