| @@ -10,14 +10,15 @@ | ||
| 10 | 10 | if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly |
| 11 | 11 | |
| 12 | 12 | global $property; |
| 13 | 13 | |
| 14 | +// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Template-local variable; the template is included through a helper/function scope, so PrefixAllGlobals misclassifies the file when checked standalone. | |
| 14 | 15 | $summary_length = apply_filters('propertyhive_search_summary_length', 300); |
| 15 | 16 | ?> |
| 16 | 17 | <div class="summary"> |
| 17 | 18 | |
| 18 | 19 | <?php |
| 19 | - echo substr(strip_tags($property->post_excerpt), 0, $summary_length); | |
| 20 | - if ( strlen(strip_tags($property->post_excerpt)) > $summary_length ) { echo '...'; } | |
| 20 | + echo esc_html( substr( wp_strip_all_tags( $property->post_excerpt ), 0, $summary_length ) ); | |
| 21 | + if ( strlen(wp_strip_all_tags($property->post_excerpt)) > $summary_length ) { echo '...'; } | |
| 21 | 22 | ?> |
| 22 | 23 | |
| 23 | 24 | </div> |