Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grid view converts CSV column header 'title' to the site title #2923

Closed
MrkGrgsn opened this issue Mar 21, 2016 · 5 comments
Closed

Grid view converts CSV column header 'title' to the site title #2923

MrkGrgsn opened this issue Mar 21, 2016 · 5 comments

Comments

@MrkGrgsn
Copy link
Contributor

@MrkGrgsn MrkGrgsn commented Mar 21, 2016

For CSV resources with a column header of 'Title', the grid and data explorer previews displays the site title as the header of this column. The expected behaviour is that it would simply display "Title". Observed in CKAN 2.3.1.

@MrkGrgsn
Copy link
Contributor Author

@MrkGrgsn MrkGrgsn commented Mar 21, 2016

Screenshot
title error

@amercader amercader self-assigned this Mar 22, 2016
@smotornyuk
Copy link
Member

@smotornyuk smotornyuk commented Mar 30, 2016

What is the purpose of sanitizeFieldName function? Because of it's name, i thought that it removes/encodes all special chars, but instead of it, fieldName used as selector for dom element. Because of this we have that interesting behaviour using column names like 'title', 'div', '#some-id-that-can-appears-on-the-page'. Probably this function must be rewrited to something that really escapes/removes special chars?

@amercader
Copy link
Member

@amercader amercader commented Mar 30, 2016

@smotornyuk the original goal was to avoid injections as SlickGrid will evaluate the header contents:

datopian/portal.js@0990dce

My solution is obviously not optimal so if you can come up with a better one that would be great

@smotornyuk
Copy link
Member

@smotornyuk smotornyuk commented Apr 5, 2016

@amercader i created pull request. I prefer this way because it encodes required entities and we haven't need to mess with regExps or any other kind of replacement directly)

@amercader
Copy link
Member

@amercader amercader commented Apr 15, 2016

Fix for this in #2961

@wardi wardi closed this in #2961 Apr 19, 2016
wardi added a commit that referenced this issue Apr 19, 2016
[#2923] Proper sanitation of header name on SlickGrid view
amercader added a commit that referenced this issue Jun 7, 2016
amercader added a commit that referenced this issue Aug 26, 2016
amercader added a commit that referenced this issue Aug 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants