]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Photo.php
Use a constant for the avatar base path
[friendica.git] / src / Model / Photo.php
index 8583577890aa898424ae107ff44a90585028be85..6537c41d1fd81158c75b1a011b7a3127f3f52910 100644 (file)
@@ -710,6 +710,18 @@ class Photo
                return $image_uri;
        }
 
+       /**
+        * Checks if the given URL is a local photo.
+        * Since it is meant for time critical occasions, the check is done without any database requests.
+        *
+        * @param string $url
+        * @return boolean
+        */
+       public static function isPhotoURI(string $url): bool
+       {
+               return !empty(self::ridFromURI($url));
+       }
+
        /**
         * Changes photo permissions that had been embedded in a post
         *