Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

[PATCH] remote_function shouldn't escape string urls

#3312

When a URL specified as a hash is passed to remote_function, it (correctly) does not HTML-escape the URL in the output:

  remote_function(:url => {:action => "whatnot", :a => 10, :b => 20})

results in:

  new Ajax.Request('http://www.example.com/whatnot?a=10&b=20', {asynchronous:true, evalScripts:true})

However, when a string is specified, the URL is escaped:

  remote_function(:url => 'http://www.example.com/whatnot?a=10&b=20')

results in:

  new Ajax.Request('http://www.example.com/whatnot?a=10&b=20', {asynchronous:true, evalScripts:true})

This results in a problem when using named routes with remote_function in

The attached patch causes string URLs to no longer be HTML-escaped. It applies cleanly against master and 2-3-stable.

Note that this is similar to #2593 Add an :escape_url option to remote_function which adds an :escape_url option.

Reported by Phil Ross · October 2nd, 2009 @ 12:34 PM

State: stale
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Phil Ross
    Phil Ross

    I've just looked at #2593 Add an :escape_url option to remote_function more closely. #2593 Add an :escape_url option to remote_function is about disabling the escape_javascript part of remote_function, which isn't related to this issue.

    October 2nd, 2009 @ 12:36 PM

  2. Rohit Arondekar
    Rohit Arondekar
    • State changed from new to stale
    • Importance changed from to

    Marking ticket as stale. If this is still an issue please leave a comment with suggested changes, creating a patch with tests, rebasing an existing patch or just confirming the issue on a latest release or master/branches.

    October 6th, 2010 @ 06:41 AM