fix: App crashes on uploading an image containing "+" in its name
as we're dealing with local file URLs only here, we don't want to turn the plus signs (`+`) into spaces (leads to failing to open the file, emits an exception, crashes later on in our JS code) Fixes #9538
This commit is contained in:
parent
009861c7b4
commit
42445d4b73
|
@ -22,7 +22,7 @@ QtObject:
|
||||||
result.setup
|
result.setup
|
||||||
|
|
||||||
proc formatImagePath*(self: Utils, imagePath: string): string =
|
proc formatImagePath*(self: Utils, imagePath: string): string =
|
||||||
result = uri.decodeUrl(replace(imagePath, "file://", ""))
|
result = uri.decodeUrl(replace(imagePath, "file://", ""), decodePlus=false)
|
||||||
if defined(windows):
|
if defined(windows):
|
||||||
# Windows doesn't work with paths starting with a slash
|
# Windows doesn't work with paths starting with a slash
|
||||||
result.removePrefix('/')
|
result.removePrefix('/')
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
import QtQuick 2.13
|
import QtQuick 2.13
|
||||||
import QtQuick.Controls 2.13
|
|
||||||
import QtQuick.Layouts 1.13
|
|
||||||
import QtGraphicalEffects 1.0
|
|
||||||
|
|
||||||
import utils 1.0
|
import utils 1.0
|
||||||
import ".."
|
|
||||||
|
|
||||||
StatusChatImageValidator {
|
StatusChatImageValidator {
|
||||||
id: root
|
id: root
|
||||||
|
|
Loading…
Reference in New Issue