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

[DataGrid] Escape formulas in CSV and Excel export #13115

Merged
merged 16 commits into from
May 20, 2024

Conversation

cherniavskii
Copy link
Member

@cherniavskii cherniavskii commented May 13, 2024

Closes #11702

  • docs

@cherniavskii cherniavskii added the component: data grid This is the name of the generic UI component, not the React module! label May 13, 2024
@mui-bot
Copy link

mui-bot commented May 13, 2024

Deploy preview: https://deploy-preview-13115--material-ui-x.netlify.app/

Updated pages:

Generated by 🚫 dangerJS against 5f2dec9

@cherniavskii cherniavskii added security Pull requests that address a security vulnerability feature: Export enhancement This is not a bug, nor a new feature labels May 16, 2024
@cherniavskii cherniavskii requested a review from a team May 16, 2024 18:05
/**
* If `true`, the formulas in the cells will be escaped.
* It is recommended to set this to `true` for security reasons.
* @default false
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mui/xgrid What do you think about making it true by default?
Technically, it's a breaking change, but it's also a security fix.
Any objections?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No objection, we should change it.

@cherniavskii cherniavskii marked this pull request as ready for review May 16, 2024 18:07
* It is recommended to set this to `true` for security reasons.
* @default false
*/
escapeFormulae?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

escapeFormulas? From what I can read online formulas seems to be the most popular plural for formula.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I followed the same naming that exceljs used:

But I actually prefer escapeFormulas, I'll update 👍🏻

@cherniavskii cherniavskii merged commit 8515a27 into mui:master May 20, 2024
17 checks passed
@cherniavskii cherniavskii deleted the escape-fomulas branch May 20, 2024 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature feature: Export security Pull requests that address a security vulnerability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[data grid] Sanitize cells with formulas for CSV export used in Excel
5 participants