envato / envato-theme-check

The WordPress Theme Check plugin for Envato
GNU General Public License v2.0
208 stars 57 forks source link

False positive for echo ( $var #32

Closed drinkmaker closed 5 years ago

drinkmaker commented 6 years ago

Hello,

Here is warning: WARNING: Found echo ( $ in the file...Possible data validation issues found. All dynamic data must be correctly escaped for the context where it is rendered.

Here is code:

<article id="comment-<?php comment_ID(); ?>" class="uk-comment <?php echo ( $comment->user_id > 0 ) ? 'uk-comment-primary' : ''; ?>">

As you can see, here we have false positive because of short syntax "if".

scottparry commented 5 years ago

Yes, that won't fail when reviewers check. Anything that is a WARNING is for reviewers to check due to possible false positives.