← All changes
|
includes/avada-widgets/property-features-shortcode.php
+8
-1
2.2.2
→
2.3.1
View file →
| @@ -1,6 +1,11 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 4 | + exit; | |
| 5 | +} | |
| 6 | + | |
| 7 | + | |
| 3 | 8 | add_shortcode( 'avada_property_features', function( $atts ) { |
| 4 | 9 | $atts = shortcode_atts( array( |
| 5 | 10 | 'content_align' => 'left', |
| 6 | 11 | 'fusion_font_family_features_font' => '', |
| @@ -23,8 +28,9 @@ | ||
| 23 | 28 | global $property; |
| 24 | 29 | |
| 25 | 30 | if ( empty($property) ) |
| 26 | 31 | { |
| 32 | + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound -- Shared frontend property global used by the Avada shortcode contract; changing $property would break the existing property context passed to these widgets. | |
| 27 | 33 | $property = new PH_Property(get_the_ID()); |
| 28 | 34 | } |
| 29 | 35 | |
| 30 | 36 | $style = Fusion_Builder_Element_Helper::get_font_styling( $atts, 'features_font' ); |
| @@ -55,10 +61,11 @@ | ||
| 55 | 61 | </style> |
| 56 | 62 | <?php |
| 57 | 63 | } |
| 58 | 64 | |
| 65 | + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- FusionBuilder::attributes() returns the complete HTML attribute fragment and escapes each attribute name and value. | |
| 59 | 66 | echo '<div ' . FusionBuilder::attributes( 'property-features-shortcode' ) . '> |
| 60 | - <div style="' . $style . '">'; | |
| 67 | + <div style="' . esc_attr( safecss_filter_attr( $style ) ) . '">'; | |
| 61 | 68 | propertyhive_template_single_features(); |
| 62 | 69 | echo ' |
| 63 | 70 | </div> |
| 64 | 71 | </div>'; |