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

fix: replace single quotes with '' value #1019

Merged
merged 1 commit into from
Mar 7, 2024
Merged

Conversation

dtbuchholz
Copy link
Contributor

Summary

Fixes a bug where mission contributions had unescaped single quotes, leading to a query syntax error. This fix just replaces all solo single quotes with two single quotes.

Details

Here's a tx that failed to the workd they're: https://tableland.network/api/v1/receipt/42161/0x879420e20419660251d60e31afa148f1bf61c6cdb0173104addde7dd99494871

The fix santizes the values before calling the smart contract:

const sanitizeDeliverables = deliverables.map(({ key, value }) => ({
  [key]: value.replace(/\'/g, "''"),
}));

How it was tested

Here's a testnet tx that succeeds with the fix & the word they're converted to they''re: https://mumbai.polygonscan.com/tx/0x4456d2f50ca1c83492ce1f6755389bf8d4224fc384a0638bee57460500b45d19

@dtbuchholz dtbuchholz merged commit 3188c99 into main Mar 7, 2024
8 checks passed
@dtbuchholz dtbuchholz deleted the dtb/fix-mission-escaping branch March 7, 2024 19:27
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.

2 participants