mirror of
https://github.com/friendica/friendica
synced 2025-05-02 15:44:24 +02:00
Refactor User::getAvatarUrlForId into getAvatarUrl
- Use user/owner array as parameter instead of uid - Rename $profile variables to $owner when it's the result of User::getOwnerDataByNick - Replace Module\Photo::stripExtension with native pathinfo() calls
This commit is contained in:
parent
810699b454
commit
7cdd2d1336
14 changed files with 78 additions and 107 deletions
|
@ -799,22 +799,6 @@ class Photo
|
|||
Photo::update($fields, $condition);
|
||||
}
|
||||
|
||||
/**
|
||||
* Strips known picture extensions from picture links
|
||||
*
|
||||
* @param string $name Picture link
|
||||
* @return string stripped picture link
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function stripExtension($name)
|
||||
{
|
||||
$name = str_replace([".jpg", ".png", ".gif"], ["", "", ""], $name);
|
||||
foreach (Images::supportedTypes() as $m => $e) {
|
||||
$name = str_replace("." . $e, "", $name);
|
||||
}
|
||||
return $name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch the guid and scale from picture links
|
||||
*
|
||||
|
@ -831,7 +815,7 @@ class Photo
|
|||
return [];
|
||||
}
|
||||
|
||||
$guid = self::stripExtension($guid);
|
||||
$guid = pathinfo($guid, PATHINFO_FILENAME);
|
||||
if (substr($guid, -2, 1) != "-") {
|
||||
return [];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue