Skip to content

Commit dec3814

Browse files
committed
Flag strip_tags and suggest wp_strip_all_tags instead
Since the `strip_tags` function is not removing CSS and JS in between the script and style tags, the `wp_strip_all_tags` should be used instead. Fixes #24
1 parent 70a46a1 commit dec3814

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

WordPressVIPMinimum/Sniffs/VIP/RestrictedFunctionsSniff.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,13 @@ public function getGroups() {
4444
),
4545
),
4646
),
47+
'strip_tags' => array(
48+
'type' => 'error',
49+
'message' => '%s does not strip CSS and JS in between the script and style tags. `wp_strip_all_tags` should be used instead.',
50+
'functions' => array(
51+
'strip_tags'
52+
),
53+
),
4754
);
4855

4956
$original_groups['get_posts']['functions'] = array_filter( $original_groups['get_posts']['functions'], function( $v ) {

0 commit comments

Comments
 (0)