[Xfce4-commits] <midori:master> Recognize effectively empty prefixes of a stylesheet
Christian Dywan
noreply at xfce.org
Thu Oct 27 19:36:03 CEST 2011
Updating branch refs/heads/master
to 9f37c58013a520f428d7364393ba68e074de5b12 (commit)
from 4440d25e1148526a633df95cb6c801dba4d34460 (commit)
commit 9f37c58013a520f428d7364393ba68e074de5b12
Author: Christian Dywan <christian at twotoasts.de>
Date: Thu Oct 27 19:28:40 2011 +0200
Recognize effectively empty prefixes of a stylesheet
extensions/addons.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/extensions/addons.c b/extensions/addons.c
index 190cfdb..e08f45d 100644
--- a/extensions/addons.c
+++ b/extensions/addons.c
@@ -1070,6 +1070,28 @@ css_metadata_from_file (const gchar* filename,
g_io_channel_shutdown (channel, false, 0);
g_io_channel_unref (channel);
+ if (*includes != NULL)
+ {
+ /* Styles may have a whitelist even though it is as good as none.
+ It's more efficient if we avoid that. */
+ GSList* list = *includes;
+ gboolean effectively_empty = TRUE;
+ while (list != NULL)
+ {
+ if (!g_str_has_suffix (list->data, "://"))
+ {
+ effectively_empty = FALSE;
+ break;
+ }
+ list = g_slist_next (list);
+ }
+ if (effectively_empty)
+ {
+ g_slist_free (list);
+ *includes = NULL;
+ }
+ }
+
return TRUE;
}
More information about the Xfce4-commits
mailing list