[Xfce4-commits] <midori:master> Skip site data rule policy check on empty rules
Christian Dywan
noreply at xfce.org
Tue Feb 28 23:56:06 CET 2012
Updating branch refs/heads/master
to 70b85bf6009427751b8caa15867fe6488eddd7f8 (commit)
from 271cdf670bcf9a1e384d265a5a0ade5b2905fd69 (commit)
commit 70b85bf6009427751b8caa15867fe6488eddd7f8
Author: Christian Dywan <christian at twotoasts.de>
Date: Tue Feb 28 23:51:31 2012 +0100
Skip site data rule policy check on empty rules
midori/midori-websettings.c | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/midori/midori-websettings.c b/midori/midori-websettings.c
index f8d6379..910a4ba 100644
--- a/midori/midori-websettings.c
+++ b/midori/midori-websettings.c
@@ -1238,6 +1238,15 @@ MidoriSiteDataPolicy
midori_web_settings_get_site_data_policy (MidoriWebSettings* settings,
const gchar* uri)
{
+ MidoriSiteDataPolicy policy = MIDORI_SITE_DATA_UNDETERMINED;
+ gchar* hostname;
+ const gchar* match;
+
+ g_return_val_if_fail (MIDORI_IS_WEB_SETTINGS (settings), policy);
+
+ if (!(settings->site_data_rules && *settings->site_data_rules))
+ return policy;
+
/*
* Values prefixed with "-" are always blocked
* Values prefixed with "+" are always accepted
@@ -1246,9 +1255,8 @@ midori_web_settings_get_site_data_policy (MidoriWebSettings* settings,
* FIXME: indicate type of storage the rule applies to
* FIXME: support matching of the whole URI
**/
- MidoriSiteDataPolicy policy = MIDORI_SITE_DATA_UNDETERMINED;
- gchar* hostname = midori_uri_parse_hostname (uri, NULL);
- const gchar* match = strstr (settings->site_data_rules, hostname ? hostname : uri);
+ hostname = midori_uri_parse_hostname (uri, NULL);
+ match = strstr (settings->site_data_rules, hostname ? hostname : uri);
if (match != NULL && match != settings->site_data_rules)
{
const gchar* prefix = match - 1;
More information about the Xfce4-commits
mailing list