Eoin Curran
2007-Oct-07 18:04 UTC
Prototype JSONFilter (secure delimiters) doesn''t support newlines
Playing with adding the secure delimiters where javascript is output from rjs. I''ve found that the JSONFilter regex doesn''t work if there are newlines in the javascript, which I fixed with: Prototype.JSONFilter = /^\/\*-secure-\s*([\s\S]*)\s*\*\/\s*$/ (works to just put this in application.js) using [\s\S]* instead of .* between the secure delimiters. Does anyone know if the regex not-matching newlines is intentional? Thanks, e. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Tobie Langel
2007-Oct-07 23:35 UTC
Re: Prototype JSONFilter (secure delimiters) doesn''t support newlines
Hi, That''s been fixed in trunk for a while. Regards, Tobie On Oct 7, 8:04 pm, Eoin Curran <curr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Playing with adding the secure delimiters where javascript is output > from rjs. > > I''ve found that the JSONFilter regex doesn''t work if there are > newlines in the javascript, which I fixed with: > Prototype.JSONFilter = /^\/\*-secure-\s*([\s\S]*)\s*\*\/\s*$/ > (works to just put this in application.js) > > using [\s\S]* instead of .* between the secure delimiters. > > Does anyone know if the regex not-matching newlines is intentional? > > Thanks, > e.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Eoin Curran
2007-Oct-08 14:33 UTC
Re: Prototype JSONFilter (secure delimiters) doesn''t support newlines
Sorry - should have spotted that - (accidentally overwrote my trunk prototype.js with a 1.5.1 from scriptaculous beta3). http://dev.rubyonrails.org/ticket/8271 regards, e. On Oct 8, 12:35 am, Tobie Langel <tobie.lan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > That''s been fixed in trunk for a while. > > Regards, > > Tobie > > On Oct 7, 8:04 pm, Eoin Curran <curr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Playing with adding the secure delimiters where javascript is output > > from rjs. > > > I''ve found that the JSONFilter regex doesn''t work if there are > > newlines in the javascript, which I fixed with: > > Prototype.JSONFilter = /^\/\*-secure-\s*([\s\S]*)\s*\*\/\s*$/ > > (works to just put this in application.js) > > > using [\s\S]* instead of .* between the secure delimiters. > > > Does anyone know if the regex not-matching newlines is intentional? > > > Thanks, > > e.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---