]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Photo.php
Added support for image descriptions and multiple image posts to external services
[friendica.git] / src / Model / Photo.php
index c983fdc0585e507559b8537e16abe6b7d4688d51..e722444b18378c6b173aafef03a120470f513834 100644 (file)
@@ -709,4 +709,22 @@ class Photo extends BaseObject
                $guid = substr($guid, 0, -2);
                return $guid;
        }
+
+       /**
+        * Tests if the picture link points to a locally stored picture
+        *
+        * @param string $name Picture link
+        * @return boolean
+        * @throws \Exception
+        */
+       public static function isLocal($name)
+       {
+               $guid = self::getGUID($name);
+
+               if (empty($guid)) {
+                       return false;
+               }
+
+               return DBA::exists('photo', ['resource-id' => $guid]);
+       }
 }