]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Photo.php
Add support for legacy $lang config in App->loadConfig
[friendica.git] / src / Model / Photo.php
index e4e609155cc625d8f70e17d82ba71ac9bcb1686f..b08c6f0459b8654fe0fdfa220255e24107674376 100644 (file)
@@ -45,7 +45,7 @@ class Photo
                if (DBM::is_result($photo)) {
                        $guid = $photo['guid'];
                } else {
-                       $guid = get_guid();
+                       $guid = System::createGUID();
                }
 
                $existing_photo = dba::selectFirst('photo', ['id'], ['resource-id' => $rid, 'uid' => $uid, 'contact-id' => $cid, 'scale' => $scale]);
@@ -100,7 +100,7 @@ class Photo
                if (x($photo['resource-id'])) {
                        $hash = $photo['resource-id'];
                } else {
-                       $hash = photo_new_resource();
+                       $hash = self::newResource();
                }
 
                $photo_failure = false;
@@ -267,4 +267,14 @@ class Photo
                $key = "photo_albums:".$uid.":".local_user().":".remote_user();
                Cache::set($key, null, CACHE_DAY);
        }
+
+       /**
+        * Generate a unique photo ID.
+        *
+        * @return string
+        */
+       public static function newResource()
+       {
+               return system::createGUID(32, false);
+       }
 }