From 56abd477e56980dec330b0893d227b519380ebcbc606e4a605eed60582b5f67f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Lie?= Date: Mon, 21 Oct 2024 18:07:33 +0000 Subject: [PATCH] - Add epiphany-fix-parsing-encoded-session-urls.patch: Fix crash when parsing already encoded session URLs. (bsc#1231823, glgo#GNOME/epiphany!1655) OBS-URL: https://build.opensuse.org/package/show/GNOME:Factory/epiphany?expand=0&rev=411 --- ...any-fix-parsing-encoded-session-urls.patch | 32 +++++++++++++++++++ epiphany.changes | 7 ++++ epiphany.spec | 2 ++ 3 files changed, 41 insertions(+) create mode 100644 epiphany-fix-parsing-encoded-session-urls.patch diff --git a/epiphany-fix-parsing-encoded-session-urls.patch b/epiphany-fix-parsing-encoded-session-urls.patch new file mode 100644 index 0000000..683e42b --- /dev/null +++ b/epiphany-fix-parsing-encoded-session-urls.patch @@ -0,0 +1,32 @@ +From 292581fba4847db476eeb04dbc869fefe50ec973 Mon Sep 17 00:00:00 2001 +From: Alynx Zhou +Date: Mon, 21 Oct 2024 10:46:05 +0800 +Subject: [PATCH] ephy-session: Correctly parse %-encoded URIs + +Because we already have %-encoded URIs for sessions, tell GUri don't +encode our URIs anymore by setting `G_URI_FLAGS_ENCODED` flag. Otherwise +GUri will fail to parse them. + +Fixes #2500. +--- + src/ephy-session.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/src/ephy-session.c b/src/ephy-session.c +index b2ebb42b2f..343577d528 100644 +--- a/src/ephy-session.c ++++ b/src/ephy-session.c +@@ -895,7 +895,9 @@ session_seems_reasonable (GList *windows) + if (g_str_has_prefix (url, "about:")) + continue; + +- uri = g_uri_parse (url, G_URI_FLAGS_PARSE_RELAXED, NULL); ++ uri = g_uri_parse (url, ++ G_URI_FLAGS_ENCODED | G_URI_FLAGS_PARSE_RELAXED, ++ NULL); + if (uri) { + if (g_uri_get_host (uri) != NULL || + strcmp (g_uri_get_scheme (uri), "file") == 0 || +-- +GitLab + diff --git a/epiphany.changes b/epiphany.changes index 6d95a26..17ecded 100644 --- a/epiphany.changes +++ b/epiphany.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Mon Oct 21 03:37:09 UTC 2024 - Alynx Zhou + +- Add epiphany-fix-parsing-encoded-session-urls.patch: Fix crash + when parsing already encoded session URLs. (bsc#1231823, + glgo#GNOME/epiphany!1655) + ------------------------------------------------------------------- Mon Oct 14 18:13:09 UTC 2024 - Bjørn Lie diff --git a/epiphany.spec b/epiphany.spec index 7cbddab..c12489b 100644 --- a/epiphany.spec +++ b/epiphany.spec @@ -24,6 +24,8 @@ License: GPL-3.0-or-later Group: Productivity/Networking/Web/Browsers URL: https://wiki.gnome.org/Apps/Web Source0: %{name}-%{version}.tar.zst +# PATCH-FIX-UPSTREAM epiphany-fix-parsing-encoded-session-urls.patch bsc#1231823, glgo#GNOME/epiphany!1655 alynx.zhou@suse.com -- Fix crash when parsing session URLs which are encoded +Patch0: epiphany-fix-parsing-encoded-session-urls.patch BuildRequires: desktop-file-utils BuildRequires: fdupes