Made message signing in Cryptography use SHA512 as the message content for... #1
2 changed files with 10 additions and 5 deletions
|
@ -40,7 +40,7 @@
|
|||
return $rpcRequest->produceError(StandardError::RPC_BAD_REQUEST, "Failed to decode JPEG image base64 data");
|
||||
}
|
||||
|
||||
$sanitizedImage = Utilities::resizeImage(Utilities::sanitizeJpeg($decodedImage), 126, 126);
|
||||
$sanitizedImage = Utilities::resizeImage(Utilities::sanitizeJpeg($decodedImage), 256, 256);
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
|
@ -53,11 +53,8 @@
|
|||
RegisteredPeerManager::updateDisplayPicture($request->getPeer(), $sanitizedImage);
|
||||
|
||||
// Check & update the session flow
|
||||
if($request->getSession()->flagExists(SessionFlags::SET_DISPLAY_PICTURE))
|
||||
{
|
||||
SessionManager::updateFlow($request->getSession(), [SessionFlags::SET_DISPLAY_PICTURE]);
|
||||
}
|
||||
}
|
||||
catch(Exception $e)
|
||||
{
|
||||
throw new StandardException('Failed to update display picture: ' . $e->getMessage(), StandardError::INTERNAL_SERVER_ERROR, $e);
|
||||
|
|
|
@ -471,11 +471,19 @@
|
|||
|
||||
if($peer->isExternal())
|
||||
{
|
||||
// TODO: Implement this
|
||||
throw new InvalidArgumentException('Cannot delete the display picture of an external peer');
|
||||
}
|
||||
|
||||
Logger::getLogger()->verbose(sprintf("Deleting display picture of peer %s", $peer->getUuid()));
|
||||
|
||||
// Delete the file if it exists
|
||||
$displayPicturePath = Configuration::getStorageConfiguration()->getUserDisplayImagesPath() . DIRECTORY_SEPARATOR . $peer->getDisplayPicture() . '.jpeg';
|
||||
if(file_exists($displayPicturePath))
|
||||
{
|
||||
unlink($displayPicturePath);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$statement = Database::getConnection()->prepare('UPDATE `registered_peers` SET display_picture=NULL WHERE uuid=?');
|
||||
|
|
Loading…
Add table
Reference in a new issue