You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Started GET "/userfiles/5596075/content?content_loader=raw_content&file_name=CAPT0000001_ReconAll%2Fmri%2Fbrain
.finalsurfs.mgz&viewer_userfile_class=MghFile" for xxx.xxx.xxx.xxx at 2025-04-02 16:02:56 -0400
Processing by UserfilesController#content as */*
Parameters: {"content_loader"=>"raw_content", "amp"=>nil, "file_name"=>"CAPT0000001_ReconAll/mri/brain.finalsurfs
.mgz", "viewer_userfile_class"=>"MghFile", "id"=>"5596075"}
It's obvious that the parameter 'amp' is a mistake because the query parameters contain an HTML-escaped & instead of the actual '&'
I think this is from the the FileCollection viewer maybe?
The text was updated successfully, but these errors were encountered:
Good catch. The example you noticed indeed came from a File Collection, yet that's how CBRAIN handles all MINC, NifTi or MGH files. this issue occurs with isolated files too. The same kind of URL with html-escaped ampersand is invoked by a single file view as well.
So it seems more related to cbrain-plugins-neuro templates than core CBRAIN
It appears that the MINC/BrainBrowser-based viewer's HTML template is actually disguised JS, and JavaScript may have slightly different escape rules for strings. It does not interpret & the same way HTML does. Preventing escape with raw helper <%= raw content_userfile_path .... %> or even plain search and replace might work. I'd apply some JavaScript escaping with something like escape_javascript .
Luckily, it seems that most browsers still support the semicolon (;) for query parameter separation, so the files are still displayed correctly.
Tell me if I should take a deeper look, or submit a PR.
I was watching rails logs and saw these lines:
It's obvious that the parameter 'amp' is a mistake because the query parameters contain an HTML-escaped
&
instead of the actual '&'I think this is from the the FileCollection viewer maybe?
The text was updated successfully, but these errors were encountered: