[Webkit-unassigned] [Bug 25649] New: [webkit-gtk] Wrong handling of file upload if no file selected

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri May 8 12:07:29 PDT 2009


https://bugs.webkit.org/show_bug.cgi?id=25649

           Summary: [webkit-gtk] Wrong handling of file upload if no file
                    selected
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Other
               URL: http://forum.gmc-clan.de
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P1
         Component: WebKit Gtk
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: nomad at froevel.de


I faced a problem on our forum when using Midori, a WebKit-GTK browser. I tried
to reply to a post but as soon as I clicked on submit I got the error message
that my file upload was broken (empty). I was so irritated by this error
message that I wrote a short html file containing a form for file upload (see
attachment).

If I load this page and press submit without choosing a file I'll get this
$_FILES array in a php script:

Array
(
    [file_test] => Array
        (
            [name] => .
            [type] => application/octet-stream
            [tmp_name] => /tmp/phpgo127Y
            [error] => 0
            [size] => 0
        )
)

WebKit-GTK tried to upload a file called "." without a file selected for
upload. I have never clicked on the button to choose any file. I found the
problem in WebCore/platform/gtk/FileSystemGtk.cpp near line 180 in the function
pathGetFileName(...). As the documentation of glib for function
"g_path_get_basename" says it will return the file name "." (dot) if the string
is empty and WebKit wants to send an empty file name. So write a patch (see
attachment again) returning an empty string if the given file name and path is
empty also. Now I can post again in my forum and I get this result in my php
script:

rray
(
    [file_test] => Array
        (
            [name] => 
            [type] => 
            [tmp_name] => 
            [error] => 4
            [size] => 0
        )
)

Regards,
Stephan Haller


-- 
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