From f45c06c09cacca59b1e0bb66277f26e8abd9e8e0 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Tue, 11 Mar 2014 22:23:51 +0000 Subject: [PATCH] Avoid searching HTML tags when searching plugins and themes. Fixes #27136. Props enej. git-svn-id: https://develop.svn.wordpress.org/trunk@27507 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-plugins-list-table.php | 6 ++++-- src/wp-admin/includes/class-wp-themes-list-table.php | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/wp-admin/includes/class-wp-plugins-list-table.php b/src/wp-admin/includes/class-wp-plugins-list-table.php index 0162ee4cbe..6535833710 100644 --- a/src/wp-admin/includes/class-wp-plugins-list-table.php +++ b/src/wp-admin/includes/class-wp-plugins-list-table.php @@ -177,9 +177,11 @@ class WP_Plugins_List_Table extends WP_List_Table { if ( is_null( $term ) ) $term = wp_unslash( $_REQUEST['s'] ); - foreach ( $plugin as $value ) - if ( stripos( $value, $term ) !== false ) + foreach ( $plugin as $value ) { + if ( false !== stripos( strip_tags( $value ), $term ) ) { return true; + } + } return false; } diff --git a/src/wp-admin/includes/class-wp-themes-list-table.php b/src/wp-admin/includes/class-wp-themes-list-table.php index 9aa182be6e..be75de02a6 100644 --- a/src/wp-admin/includes/class-wp-themes-list-table.php +++ b/src/wp-admin/includes/class-wp-themes-list-table.php @@ -222,8 +222,9 @@ class WP_Themes_List_Table extends WP_List_Table { foreach ( array( 'Name', 'Description', 'Author', 'AuthorURI' ) as $header ) { // Don't mark up; Do translate. - if ( false !== stripos( $theme->display( $header, false, true ), $word ) ) + if ( false !== stripos( strip_tags( $theme->display( $header, false, true ) ), $word ) ) { continue 2; + } } if ( false !== stripos( $theme->get_stylesheet(), $word ) )