]> BookStack Code Mirror - bookstack/blobdiff - app/Uploads/Attachment.php
Increased attachment link limit from 192 to 2k
[bookstack] / app / Uploads / Attachment.php
index 01c927382e6c90217d2ddc39a61ce82c85144265..e33b13db449a8f51eca600ff7eb4cb2a10242ae0 100644 (file)
@@ -40,12 +40,10 @@ class Attachment extends Model
 
     /**
      * Get the downloadable file name for this upload.
-     *
-     * @return mixed|string
      */
-    public function getFileName()
+    public function getFileName(): string
     {
-        if (strpos($this->name, '.') !== false) {
+        if (str_contains($this->name, '.')) {
             return $this->name;
         }
 
@@ -71,7 +69,7 @@ class Attachment extends Model
      */
     public function getUrl($openInline = false): string
     {
-        if ($this->external && strpos($this->path, 'http') !== 0) {
+        if ($this->external && !str_starts_with($this->path, 'http')) {
             return $this->path;
         }