Giter VIP home page Giter VIP logo

Comments (2)

savetheclocktower avatar savetheclocktower commented on July 18, 2024

I can see this happening in 1.7.1, but I get varying results in 1.7.2. Here's the same fiddle using 1.7.2 and scripty 1.9. In Chrome dev tools, your fiddle says the value is a+++b+++c, whereas on mine it says it's sending a + b + c. (Clicking the "view URL encoded" link shows what you'd expect.) Same with Safari.

In Firefox dev tools, both fiddles say they're sending a+++b+++c, but I suspect that's a bug in Firefox's dev tools. Therefore I'm inclined to close this and say it's fixed in 1.7.2. Anyone who has evidence that this is not yet fixed should feel free to reopen this bug.

from prototype.

laurinkeithdavis avatar laurinkeithdavis commented on July 18, 2024

Actually, we modified 1.7.1 a long time ago to fix this issue, by removing this line:

value = value.gsub(/%20/, '+'); *

From this:

serializeElements: function(elements, options){
    if(typeof options != 'object') options = { hash: !!options };
    else
        if(Object.isUndefined(options.hash)) options.hash = true;
    var key, value, submitted = false, submit = options.submit, accumulator, initial;

    if(options.hash){
        initial = {};
        accumulator = function(result, key, value){
            if(key in result){
                if(!Object.isArray(result[key])) result[key] = [result[key]];
                result[key].push(value);
            }else result[key] = value;
            return result;
        };
    }else{
        initial = '';
        accumulator = function(result, key, value){
            value = value.gsub(/(\r)?\n/, '\r\n');
            value = encodeURIComponent(value);
            //value = value.gsub(/%20/, '+'); *
            //BJR - 43987 - Client Dashboard - Change Name Adds "+" Signs
            return result + (result ? '&' : '') + encodeURIComponent(key) + '=' + value;
        }
    }

It was introduced in 1.7.1 and we've had no problems since removing it.

from prototype.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.