Menu

#27 apache crashes when form contains other national characters

open
mod_wxjs (6)
5
2008-12-08
2008-12-07
Anonymous
No

If i submit form and input boxes contains characters like (ě,š, č,ř, ž,ý,á) then apache crashes. It is very big problem, i am from Czech Republic.

Discussion

  • Franky Braem

    Franky Braem - 2008-12-08
    • assigned_to: nobody --> fbraem
     
  • Franky Braem

    Franky Braem - 2008-12-08

    Does this also occur with 0.9.75?

     
  • Nobody/Anonymous

    I debuged the mod_wxjs and i found, that the bug is in class ApacheTable. Because the value from javascript is "char *" and it converts to "wxString" throught the method "FromASCII". ASCII is not good the "char * value" can be in other encodings f.e. UTF-8, Windows CP1250 and others. I made simple path that is not the best but it works fine.

    In file table.cpp:

    bool AprTable::GetStringProperty(apr_table_t *p, JSContext *cx, JSObject *WXUNUSED(obj), const wxString &propertyName, jsval *vp)
    {
    const char *value = apr_table_get(p, propertyName.ToAscii());
    if ( value != NULL )
    {
    wxString valuestr = wxString::FromUTF8(value);
    if (valuestr.Len() == 0) {
    wxCSConv conv(wxFONTENCODING_CP1250);
    valuestr = wxString(value,conv);
    }

    *vp = ToJS(cx,valuestr );
    }
    return true;
    }

     

Log in to post a comment.