1. #1
    Ext User Const's Avatar
    Join Date
    Sep 2007
    Location
    Russia, Moscow
    Posts
    1
    Vote Rating
    0
    Const is on a distinguished road

      0  

    Default [2.0a1] [CLOSED] Ext.urlEncode array bug

    [2.0a1] [CLOSED] Ext.urlEncode array bug


    Bug at Ext.urlEncode function at array encoding.

    Code:
    ...
    for(var i = 0, len = ov.length; i < len; i++) {
    	buf.push(k, "=", encodeURIComponent(ov[i] === undefined ? '' : ov[i]), "&");
    }
    ...
    need to replace with
    Code:
    ...
    for(var i = 0, len = ov.length; i < len; i++) {
    	buf.push(k, "[",i,"]=", encodeURIComponent(ov[i] === undefined ? '' : ov[i]), "&");
    }
    ...


    P.S. bug come from ext 1.1.1

  2. #2
    Sencha - Community Support Team mystix's Avatar
    Join Date
    Mar 2007
    Location
    Singapore
    Posts
    6,236
    Vote Rating
    5
    mystix will become famous soon enough

      0  

    Default


    pls explain.

    [edit]
    your suggested "fix" would cause
    Code:
    Ext.urlEncode({a:1, b:[1, 2, 3]});
    to return
    Code:
    "a=1&b[0]=1&b[1]=2&b[2]=3"
    instead of
    Code:
    "a=1&b=1&b=2&b=3"
    which runs contrary to the intended purpose as defined in the API docs, and would also be interpreted differently by any server side language than what was originally intended.

    p.s. there's also a reason for the calls to the encodeURIComponent() method throughout the Ext.urlEncode method -- there shouldn't be any "["s and "]"s appearing in an URL-encoded string. are you sure you know what you're doing?

  3. #3
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    17
    jack.slocum will become famous soon enough jack.slocum will become famous soon enough

      0  

    Default


    Ext does it correctly. Take a look at the spec. I would imagine you are using it with PHP and want it to come in as an array? In that case, the php requirement is that you name the variable with a [] at the end. E.g. b[].
    Jack Slocum
    Ext JS Founder
    Original author of Ext JS 1, 2 & 3.
    Twitter: @jackslocum
    jack@extjs.com

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi