Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/extensions-leaflet-map/extensions-leaflet-map.php
+++ b/extensions-leaflet-map/extensions-leaflet-map.php
@@ -3,9 +3,8 @@
* Plugin Name: Extensions for Leaflet Map
* Description: Extends the WordPress Plugin <a href="https://wordpress.org/plugins/leaflet-map/">Leaflet Map</a> with Leaflet Plugins and other functions.
* Plugin URI: https://leafext.de/en/
- * Version: 6.2.1
+ * Version: 6.3
* Requires PHP: 8.2
- * Requires Plugins: leaflet-map
* Author: hupe13
* Author URI: https://leafext.de/en/
* License: GPL v2 or later
--- a/extensions-leaflet-map/php/extramarker.php
+++ b/extensions-leaflet-map/php/extramarker.php
@@ -51,7 +51,7 @@
'extensions-leaflet-map'
),
'default' => 'white',
- 'filter' => '',
+ 'filter' => 'color',
),
// iconRotate Rotates the icon with css transformations 0 numeric degrees
array(
@@ -82,7 +82,7 @@
'extensions-leaflet-map'
),
'default' => 'red',
- 'filter' => '',
+ 'filter' => 'color',
),
// number Instead of an icon, define a plain text '' '1' or 'A', must set icon: 'fa-number'
array(
@@ -197,7 +197,7 @@
// var_dump( $marker_shortcode );
$text = JShrinkMinifier::minify( $text );
- $atts1 = leafext_case( array_keys( leafext_extramarker_defaults() ), leafext_clear_params( $atts ) );
+ $atts1 = leafext_case( array_keys( leafext_extramarker_defaults() ), leafext_clear_params_true_false( $atts ) );
$options = shortcode_atts( leafext_extramarker_defaults(), $atts1 );
// var_dump($options);//wp_die();
@@ -236,22 +236,28 @@
if ( $v === '' ) {
continue;
}
- $text .= "$k: ";
switch ( $filters[ $k ] ) {
case 'FILTER_VALIDATE_BOOL':
$value = filter_var( $v, FILTER_VALIDATE_BOOL ) ? 'true' : 'false';
+ $text .= "$k: " . $value . ",n";
break;
case 'FILTER_SANITIZE_NUMBER_INT':
$value = filter_var( $v, FILTER_SANITIZE_NUMBER_INT );
+ $text .= "$k: " . $value . ",n";
break;
- case 'latlon':
- $value = '[' . $v . ']';
+ // case 'latlon':
+ // $text .= "$k: " . '[' . $v . ']' . ",n";
+ // break;
+ case 'color':
+ if ( leafext_valid_color( $v ) !== '' ) {
+ $text .= "$k: " . wp_json_encode( $v ) . ",n";
+ }
break;
default:
- $value = wp_json_encode( $v );
+ if ( preg_match( '%^[a-zA-Z0-9:-/._ ]+$%', $v ) ) {
+ $text .= "$k: " . wp_json_encode( $v ) . ",n";
+ }
}
- $text .= $value;
- $text .= ",n";
}
// var_dump($text); wp_die();
return $text;
--- a/extensions-leaflet-map/php/functions.php
+++ b/extensions-leaflet-map/php/functions.php
@@ -149,7 +149,7 @@
}
$head = '<div style="width:' . ( ( is_singular() || is_archive() ) ? '100' : '80' ) . '%;">';
$head = $head . '<figure class="wp-block-table aligncenter is-style-stripes"><table border=1>';
- return $head . implode( '', $rows ) . '</table></figure></div>';
+ return $head . wp_kses_post( implode( '', $rows ) ) . '</table></figure></div>';
}
}
--- a/extensions-leaflet-map/php/listmarker.php
+++ b/extensions-leaflet-map/php/listmarker.php
@@ -109,11 +109,11 @@
foreach ( $params as $param ) {
$defaults[ $param['param'] ] = $param['default'];
}
- $atts1 = leafext_case( array_keys( $defaults ), leafext_clear_params( $atts ) );
- $options = shortcode_atts( $defaults, $atts1 );
- $options['collapse'] = filter_var( $options['collapse'], FILTER_VALIDATE_BOOL );
- $options['update'] = filter_var( $options['update'], FILTER_VALIDATE_BOOL );
- $options['hover'] = filter_var( $options['hover'], FILTER_VALIDATE_BOOL );
+ $atts1 = leafext_case( array_keys( $defaults ), leafext_clear_params( $atts ) );
+ $options = shortcode_atts( $defaults, $atts1 );
+ $options['collapse'] = filter_var( $options['collapse'], FILTER_VALIDATE_BOOL );
+ $options['update'] = filter_var( $options['update'], FILTER_VALIDATE_BOOL );
+ $options['hover'] = filter_var( $options['hover'], FILTER_VALIDATE_BOOL );
if ( leafext_valid_color( $options['background'] ) !== '' && $options['background'] !== $defaults['background'] ) {
$text .= '<style>ul.list-markers-ul {background-color: ' . $options['background'] . '}</style>';
}
--- a/extensions-leaflet-map/php/multielevation.php
+++ b/extensions-leaflet-map/php/multielevation.php
@@ -365,6 +365,9 @@
$multioptions['distanceMarkers'] = false;
$multioptions['distanceMarkers_options'] = 'false';
$multioptions['sort'] = false;
+ $multioptions['highlight'] = '#ffff00';
+ $multioptions['flyToBounds'] = true;
+ $multioptions['direction'] = false;
}
if ( $shortcode === 'multielevation' ) {
@@ -511,6 +514,7 @@
echo 'highlight: {color:' . wp_json_encode( $multioptions['highlight'] ) . ',opacity: 1,},' . "n";
}
echo 'flyToBounds:' . wp_json_encode( (bool) $multioptions['flyToBounds'] ) . ',' . "n";
+ echo 'filename:' . wp_json_encode( (bool) $multioptions['filename'] ) . ',' . "n";
// default:
// distanceMarkers: true,
--- a/extensions-leaflet-map/php/overview-map.php
+++ b/extensions-leaflet-map/php/overview-map.php
@@ -407,12 +407,20 @@
$latlng_atts = shortcode_parse_atts( $leaflet_latlng );
// var_dump($latlng_atts);
if ( isset( $latlng_atts['lat'] ) && isset( $latlng_atts['lng'] ) ) {
- $leaflet_latlng = 'lat=' . trim( $latlng_atts['lat'], ', ' ) . ' lng=' . trim( $latlng_atts['lng'], ', ' );
+ $leaflet_latlng =
+ 'lat=' . filter_var( str_replace( ',', '.', trim( $latlng_atts['lat'], ', ' ) ), FILTER_VALIDATE_FLOAT ) .
+ ' lng=' . filter_var( str_replace( ',', '.', trim( $latlng_atts['lng'], ', ' ) ), FILTER_VALIDATE_FLOAT );
} else {
$leaflet_latlng = '*';
}
} else {
- $leaflet_latlng = 'lat=' . trim( $latlng[0], ', ' ) . ' lng=' . trim( $latlng[1], ', ' );
+ // var_dump( $latlng );
+ $leaflet_latlng =
+ 'lat=' . filter_var( str_replace( ',', '.', trim( $latlng[0], ', ' ) ), FILTER_VALIDATE_FLOAT ) .
+ ' lng=' . filter_var( str_replace( ',', '.', trim( $latlng[1], ', ' ) ), FILTER_VALIDATE_FLOAT );
+ }
+ if ( $leaflet_latlng === 'lat= lng=' ) {
+ $leaflet_latlng = '*';
}
} else {
$leaflet_latlng = '*';