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

Comments

Projects
None yet
3 participants
@MrkGrgsn
Copy link
Contributor

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

This comment has been minimized.

Copy link
Contributor Author

commented Mar 21, 2016

Screenshot
title error

@amercader amercader self-assigned this Mar 22, 2016

@smotornyuk

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Member

commented Mar 30, 2016

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

okfn/recline@0990dce

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

@smotornyuk

This comment has been minimized.

Copy link
Member

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

This comment has been minimized.

Copy link
Member

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

Merge pull request #2961 from ckan/2923-recline-headers
[#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
You can’t perform that action at this time.