]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/Photo.php
Merge pull request #10813 from tobiasd/20211003-lengthcounter
[friendica.git] / src / Module / Photo.php
index 32403a5d1a8dc133cdb1f11769be4b5f7328a10d..ea6af2636739ee66533025796f1269a779b89875 100644 (file)
@@ -97,9 +97,14 @@ class Photo extends BaseModule
                                $uid = intval(pathinfo($parameters['uid_ext'], PATHINFO_FILENAME));
                        }
 
+                       // Please refactor this for the love of everything that's good
+                       if (!empty($parameters['id'])) {
+                               $uid = $parameters['id'];
+                       }
+
                        $photo = self::getAvatar($uid, $parameters['type'], $customsize ?: Proxy::PIXEL_SMALL);
                } else {
-                       $photoid = MPhoto::stripExtension($parameters['name']);
+                       $photoid = pathinfo($parameters['name'], PATHINFO_FILENAME);
                        $scale = 0;
                        if (substr($photoid, -2, 1) == "-") {
                                $scale = intval(substr($photoid, -1, 1));