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

Prevent Object properties to be used as parsing functions #10570

Merged
merged 1 commit into from
Aug 7, 2022

Conversation

matias-la
Copy link
Contributor

Please provide enough information so that others can review your pull request.

Motivation

parseQueryParams() could had unexpected behavior when parameter names where valid Object.prototype properties. For example:

> parseQueryParams('?toString=42', {})
[Object: null prototype] { toString: '[object Object]' }

The code above was returning {toString: '[object Object]'} instead of the expected {toString: '42'}.

Test plan

Added a unit test reproducing the bug.

@netlify
Copy link

netlify bot commented May 5, 2022

Deploy Preview for react-navigation-example ready!

Name Link
🔨 Latest commit e32e9c7
🔍 Latest deploy log https://app.netlify.com/sites/react-navigation-example/deploys/62bf45ae35d7bd0008ac9d0f
😎 Deploy Preview https://deploy-preview-10570--react-navigation-example.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@satya164
Copy link
Member

Thanks for the PR. Looks like CI is failing due to lint errors. Can you fix them?

@matias-la
Copy link
Contributor Author

Sorry about that. Fixed and rebased!

Copy link
Member

@satya164 satya164 left a comment

Choose a reason for hiding this comment

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

Thanks

@satya164 satya164 merged commit 7fbd3e5 into react-navigation:main Aug 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants