magento-coding-standard icon indicating copy to clipboard operation
magento-coding-standard copied to clipboard

Rector rule added to escape unsafe output in phtml files

Open Jakhotiya opened this issue 7 months ago • 3 comments

Summary

Often a codebase is handed over to you which does not follow all magento standards and phpcs starts flagging them. One such example is unsafe output in template files. For a large number of files, its cumbersome to refactor these files. Rector rule can do this quickly. This pull requests addresses that.

Checks done.

Added test cases for the rector rule. Ran it on actual template files

Things not covered

This does not yet implement escapeJs and escapeUrl functions. Should be able to add it soon. This PR should also help people to get started with writing such rules.

Jakhotiya avatar Nov 15 '23 14:11 Jakhotiya