reactplay / react-play

react-play is an opensource platform that helps you learn ReactJS faster with hands-on practice model. It is a collection of projects that you can use to learn ReactJS.
https://reactplay.io
MIT License
1.36k stars 843 forks source link

Fix code scanning alert no. 2: Incomplete string escaping or encoding #1543

Closed priyankarpal closed 1 month ago

priyankarpal commented 1 month ago

Fixes https://github.com/reactplay/react-play/security/code-scanning/2

To fix the problem, we need to ensure that all occurrences of the '%' character in the prevExpression string are replaced with '*100/' before evaluating the expression. This can be achieved by using a regular expression with the global flag (/g). This change ensures that every '%' character in the string is replaced, preventing any potential issues with incomplete replacements.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

netlify[bot] commented 1 month ago

Deploy Preview for reactplayio ready!

Name Link
Latest commit a83f21aae911d96d8be606213dbf111fde001d80
Latest deploy log https://app.netlify.com/sites/reactplayio/deploys/6707e0a9f27c3c0008af4662
Deploy Preview https://deploy-preview-1543--reactplayio.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 configuration.