-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #1359: Prevent passing as CLI argument causing a useless subscr…
…iption. Also checks for duplicates when subscribing from CLI/DBUS.
- Loading branch information
Showing
2 changed files
with
25 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
To be released | ||
|
||
Version 1.15.8 | ||
|
||
* Fixes #1359: Prevent passing "" as CLI argument causing a useless subscription. | ||
Also checks for duplicates when subscribing from CLI/DBUS. | ||
(Lars Windolf) | ||
|
||
|
||
2024-06-19 Lars Windolf <[email protected]> | ||
|
||
Version 1.15.7 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
/** | ||
* @file main.c Liferea startup | ||
* | ||
* Copyright (C) 2003-2023 Lars Windolf <[email protected]> | ||
* Copyright (C) 2003-2024 Lars Windolf <[email protected]> | ||
* Copyright (C) 2004-2006 Nathan J. Conrad <[email protected]> | ||
* | ||
* Some code like the command line handling was inspired by | ||
|
@@ -89,15 +89,23 @@ on_app_open (GApplication *application, | |
|
||
for (i=0;(i<n_files) && uris[i];i++) { | ||
gchar *uri = g_file_get_uri (uris[i]); | ||
gchar *dir = g_get_current_dir (); | ||
|
||
/* When passed to GFile feeds using the feed scheme "feed:https://" become "feed:///https:/" */ | ||
if (g_str_has_prefix (uri, "feed:///https:/")) { | ||
gchar *tmp = uri; | ||
uri = g_strdup_printf ("https://%s", uri + strlen ("feed:///https:/")); | ||
g_free (tmp); | ||
/* Prevent empty argument causing a subscription (Github #1359) */ | ||
if (!(g_str_has_prefix (uri, "file://") && g_str_equal (dir, uri + 7))) { | ||
|
||
/* When passed to GFile feeds using the feed scheme "feed:https://" become "feed:///https:/" */ | ||
if (g_str_has_prefix (uri, "feed:///https:/")) { | ||
gchar *tmp = uri; | ||
uri = g_strdup_printf ("https://%s", uri + strlen ("feed:///https:/")); | ||
g_free (tmp); | ||
} | ||
|
||
feedlist_add_subscription_check_duplicate (uri, NULL, NULL, 0); | ||
g_free (uri); | ||
} | ||
feedlist_add_subscription (uri, NULL, NULL, 0); | ||
g_free (uri); | ||
|
||
g_free (dir); | ||
} | ||
} | ||
|
||
|