Images return full URI (excl. host)
This commit is contained in:
@@ -363,13 +363,13 @@ class User implements JsonSerializable
|
||||
$stmt->bindValue(":ID", $this->id);
|
||||
$stmt->execute();
|
||||
$oldImage = $stmt->fetch(PDO::FETCH_COLUMN, 0);
|
||||
if (strpos($oldImage, "default") === false) unlink(Config::getStoragePath() . $oldImage);
|
||||
if (strpos($oldImage, "default") === false) unlink(Config::getStorageFSPath() . $oldImage);
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
|
||||
if (!empty($image)) {
|
||||
$destinationFilename = sprintf('%s.%s', uniqid(), $image->getExtension());
|
||||
$image->move(Config::getStoragePath() . "profilbilder/$destinationFilename");
|
||||
$image->move(Config::getStorageFSPath() . "profilbilder/$destinationFilename");
|
||||
|
||||
try {
|
||||
$stmt = $db->prepare("UPDATE egb_benutzer SET image = :IMG WHERE id = :ID");
|
||||
@@ -524,7 +524,7 @@ class User implements JsonSerializable
|
||||
'username' => $this->username,
|
||||
'status' => $this->status,
|
||||
'email' => htmlspecialchars($this->email),
|
||||
'image' => $this->image,
|
||||
'image' => Config::getStoragePath() . $this->image,
|
||||
'isAdmin' => $this->isAdmin,
|
||||
'memberSince' => $this->memberSince,
|
||||
'postCount' => $this->postCount,
|
||||
|
||||
Reference in New Issue
Block a user