mirror of
https://github.com/lubosz/overte.git
synced 2025-08-04 20:30:26 +02:00
use fromUserInput in web entity URL set to avoid crashable URLs
This commit is contained in:
parent
9605379265
commit
99e0c8c0e7
1 changed files with 9 additions and 2 deletions
|
@ -247,8 +247,15 @@ void RenderableWebEntityItem::render(RenderArgs* args) {
|
||||||
|
|
||||||
void RenderableWebEntityItem::setSourceUrl(const QString& value) {
|
void RenderableWebEntityItem::setSourceUrl(const QString& value) {
|
||||||
if (_sourceUrl != value) {
|
if (_sourceUrl != value) {
|
||||||
qCDebug(entities) << "Setting web entity source URL to " << value;
|
auto newURL = QUrl::fromUserInput(value);
|
||||||
_sourceUrl = value;
|
|
||||||
|
if (newURL.isValid()) {
|
||||||
|
qCDebug(entities) << "Setting web entity source URL to " << value;
|
||||||
|
_sourceUrl = newURL.toDisplayString();
|
||||||
|
} else {
|
||||||
|
qCDebug(entities) << "Clearing web entity source URL since" << value << "cannot be parsed to a valid URL.";
|
||||||
|
}
|
||||||
|
|
||||||
if (_webSurface) {
|
if (_webSurface) {
|
||||||
AbstractViewStateInterface::instance()->postLambdaEvent([this] {
|
AbstractViewStateInterface::instance()->postLambdaEvent([this] {
|
||||||
_webSurface->getRootItem()->setProperty("url", _sourceUrl);
|
_webSurface->getRootItem()->setProperty("url", _sourceUrl);
|
||||||
|
|
Loading…
Reference in a new issue