[Webkit-unassigned] [Bug 26588] New: r43791 corrupts uri with named anchor

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jun 21 13:39:11 PDT 2009


           Summary: r43791 corrupts uri with named anchor
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh
        OS/Version: Mac OS X 10.5
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: WebKit Gtk
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: dmacks at netspace.org

The following change to webkit/webkitwebview.cpp webkit_web_view_open():

-        gchar* fileUri = g_strdup_printf("file://%s", uri);
+        gchar* fileUri = g_filename_to_uri(uri, NULL, NULL);
         webkit_web_view_load_uri(webView, fileUri);

causes corruption of the uri if it contains a named anchor ("/foo/bar#quux")
rather than just a filename ("/foo/bar"). The use of named anchors with local
filenames is common in devhelp, and this change thus breaks devhelp (reverts
much of the problem solved in Bug #17176). If the given uri contains a named
anchor, that needs to get carried as a named anchor (i.e., "#foo") into
webkit_web_view_load_uri(). However, g_filename_to_uri() doesn't respect named
anchors...it treats the whole given string as the pathname and uri-encodes it,
thus converting the "#" to %23. The result is that w_v_l_uri gets
"/foo/bar/%23quux", which is obviously not the intended filename.

The solution is to parse apart the given uri: do g_filename_to_uri on the
pathname part only and then re-append the anchor if there is one.

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

More information about the webkit-unassigned mailing list