Skip to content

Templates XSS Security and short echo tag syntax #99

Closed
@noire-munich

Description

@noire-munich

Description

Consider the following code:
<input type="hidden" name="<?php /* @escapeNotVerified */ echo $block->getInputElementName();?>" value="" id="<?php /* @escapeNotVerified */ echo $_id;?>"

A template with this snippet will raise the following warning:

x | WARNING | Short echo tag syntax must be used; expected "<?=" but found "<?php echo"

Expected behavior

Template XSS Security tags are here to improve the quality of code and so are EQP tests. It seems of higher value to defend XSS Security tags than to promote the use of short echo tags over it. We should not see a Warning when a XSS Security Annotation is used.

Benefits

EQP Standards would reflect better Magento's recommandations & tools.
Reports would be less bloated with Warnings with little to no value.

Additional information

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImprovements to existing rules

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions