Rename Photo::newResource() result variable from $hash to $resource_id

This commit is contained in:
Hypolite Petovan 2019-10-26 09:05:35 -04:00
parent 03bf1dcbd3
commit 26b5de9a76
5 changed files with 41 additions and 41 deletions

View file

@ -836,9 +836,9 @@ class User
if ($Image->isValid()) {
$Image->scaleToSquare(300);
$hash = Photo::newResource();
$resource_id = Photo::newResource();
$r = Photo::store($Image, $uid, 0, $hash, $filename, L10n::t('Profile Photos'), 4);
$r = Photo::store($Image, $uid, 0, $resource_id, $filename, L10n::t('Profile Photos'), 4);
if ($r === false) {
$photo_failure = true;
@ -846,7 +846,7 @@ class User
$Image->scaleDown(80);
$r = Photo::store($Image, $uid, 0, $hash, $filename, L10n::t('Profile Photos'), 5);
$r = Photo::store($Image, $uid, 0, $resource_id, $filename, L10n::t('Profile Photos'), 5);
if ($r === false) {
$photo_failure = true;
@ -854,14 +854,14 @@ class User
$Image->scaleDown(48);
$r = Photo::store($Image, $uid, 0, $hash, $filename, L10n::t('Profile Photos'), 6);
$r = Photo::store($Image, $uid, 0, $resource_id, $filename, L10n::t('Profile Photos'), 6);
if ($r === false) {
$photo_failure = true;
}
if (!$photo_failure) {
Photo::update(['profile' => 1], ['resource-id' => $hash]);
Photo::update(['profile' => 1], ['resource-id' => $resource_id]);
}
}
}