Skip to content
This repository
Browse code

Add a few checks for escaping.

  • Loading branch information...
commit afb3e15de534c91d3c81d094287485bf5cc4211c 1 parent 7750669
Michael Fields mfields authored

Showing 1 changed file with 14 additions and 0 deletions. Show diff stats Hide diff stats

  1. +14 0 vip-scanner/checks/EscapingCheck.php
14 vip-scanner/checks/EscapingCheck.php
@@ -14,6 +14,20 @@ function check( $files ) {
14 14 ),
15 15 ),
16 16 array(
  17 + 'pattern' => '/esc_attr[\s]*?\([\s]+print[\s]+/',
  18 + 'message' => sprintf( __( '%1$s is being passed as the first parameter of %2$s.', 'vip-scanner' ),
  19 + '<code>print</code>',
  20 + '<code>esc_attr()</code>'
  21 + ),
  22 + ),
  23 + array(
  24 + 'pattern' => '/esc_attr[\s]*?\([\s]+echo[\s]+/',
  25 + 'message' => sprintf( __( '%1$s is being passed as the first parameter of %2$s.', 'vip-scanner' ),
  26 + '<code>echo</code>',
  27 + '<code>esc_attr()</code>'
  28 + ),
  29 + ),
  30 + array(
17 31 'pattern' => '/="[\s]*?<\?php[\s]+_e/',
18 32 'message' => sprintf( __( 'Please use %1$s to echo internationalized text in html attributes.', 'vip-scanner' ),
19 33 '<code>esc_attr_e()</code>'

0 comments on commit afb3e15

Please sign in to comment.
Something went wrong with that request. Please try again.