← All changes
|
includes/avada-widgets/property-address-postcode-shortcode.php
+8
-1
2.2.4
→
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_address_postcode', function( $atts ) { |
| 4 | 9 | $atts = shortcode_atts( array( |
| 5 | 10 | 'content_align' => 'left', |
| 6 | 11 | 'fusion_font_family_address_postcode_font' => '', |
| @@ -22,8 +27,9 @@ | ||
| 22 | 27 | global $property; |
| 23 | 28 | |
| 24 | 29 | if ( empty($property) ) |
| 25 | 30 | { |
| 31 | + // 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. | |
| 26 | 32 | $property = new PH_Property(get_the_ID()); |
| 27 | 33 | } |
| 28 | 34 | |
| 29 | 35 | if ( $property->address_postcode == '' ) |
| @@ -50,10 +56,11 @@ | ||
| 50 | 56 | } |
| 51 | 57 | |
| 52 | 58 | ob_start(); |
| 53 | 59 | |
| 60 | + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- FusionBuilder::attributes() returns the complete HTML attribute fragment and escapes each attribute name and value. | |
| 54 | 61 | echo '<div ' . FusionBuilder::attributes( 'property-address-postcode-shortcode' ) . '> |
| 55 | - <div style="' . $style . '">'; | |
| 62 | + <div style="' . esc_attr( safecss_filter_attr( $style ) ) . '">'; | |
| 56 | 63 | |
| 57 | 64 | echo esc_html($property->address_postcode); |
| 58 | 65 | |
| 59 | 66 | echo ' |