mirror of
https://github.com/friendica/friendica
synced 2025-04-27 18:30:12 +00:00
Improved resource id creation
This commit is contained in:
parent
d90b93cfda
commit
a3af6807ac
9 changed files with 23 additions and 37 deletions
|
@ -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,13 @@ 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 get_guid(32, false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -521,7 +521,7 @@ class User
|
|||
if ($Image->isValid()) {
|
||||
$Image->scaleToSquare(175);
|
||||
|
||||
$hash = photo_new_resource();
|
||||
$hash = Photo::newResource();
|
||||
|
||||
$r = Photo::store($Image, $uid, 0, $hash, $filename, L10n::t('Profile Photos'), 4);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue