[evolution-patches] [gtkhtml] #48058 Improper handling of <base href="">
- From: Radek Doulík <rodo novell com>
- To: Patches <evolution-patches ximian com>
- Cc: Larry Ewing <lewing ximian com>
- Subject: [evolution-patches] [gtkhtml] #48058 Improper handling of <base href="">
- Date: Thu, 23 Sep 2004 18:17:38 +0200
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/ChangeLog,v
retrieving revision 1.2035.2.3
diff -u -p -r1.2035.2.3 ChangeLog
--- ChangeLog 20 Sep 2004 16:18:00 -0000 1.2035.2.3
+++ ChangeLog 23 Sep 2004 16:13:17 -0000
@@ -1,3 +1,23 @@
+2004-09-23 Radek Doulik <rodo ximian com>
+
+ * gtkhtml.c (expand_relative): do not search for ":" in url, it
+ may be used in other parts than uri scheme delimiter. instead
+ parse beginning of url to see if it has url scheme (and thus is
+ absolute url)
+ (html_engine_set_base_cb): set base when received set_base from
+ engine
+ (url_is_absolute): new helper function to identify absolute url's
+
+ Fixes #48058
+
+2004-09-22 Radek Doulik <rodo ximian com>
+
+ * htmltext.c (html_text_remove_unwanted_line_breaks): added '-' to
+ unwanted break characters
+ (html_text_remove_unwanted_line_breaks): fix braces breaking
+
+ Fixes #54852
+
2004-09-02 Radek Doulik <rodo ximian com>
* htmlprinter.c (process_attrs): get fixed style from pango family
Index: gtkhtml.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/src/gtkhtml.c,v
retrieving revision 1.574.2.1
diff -u -p -r1.574.2.1 gtkhtml.c
--- gtkhtml.c 16 Sep 2004 17:23:06 -0000 1.574.2.1
+++ gtkhtml.c 23 Sep 2004 16:13:19 -0000
@@ -398,6 +398,7 @@ html_engine_set_base_cb (HTMLEngine *eng
GtkHTML *gtk_html;
gtk_html = GTK_HTML (data);
+ gtk_html_set_base (gtk_html, base);
g_signal_emit (gtk_html, signals[SET_BASE], 0, base);
}
@@ -1383,6 +1384,33 @@ collapse_path (char *url)
}
#endif
+static gboolean
+url_is_absolute (const char *url)
+{
+ /*
+ URI Syntactic Components
+
+ The URI syntax is dependent upon the scheme. In general, absolute
+ URI are written as follows:
+
+ <scheme>:<scheme-specific-part>
+
+ scheme = alpha *( alpha | digit | "+" | "-" | "." )
+ */
+
+ if (!url)
+ return FALSE;
+
+ if (!isalpha (*url))
+ return FALSE;
+ url ++;
+
+ while (*url && (isalnum (*url) || *url == '+' || *url == '-' || *url == '.'))
+ url ++;
+
+ return *url && *url == ':';
+}
+
static char *
expand_relative (const char *base, const char *url)
{
@@ -1390,7 +1418,7 @@ expand_relative (const char *base, const
size_t base_len, url_len;
gboolean absolute = FALSE;
- if (!base || (url && strstr (url, ":"))) {
+ if (!base || url_is_absolute (url)) {
/*
g_warning ("base = %s url = %s new_url = %s",
base, url, new_url);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]