Skip to content

Commit f443420

Browse files
release: fixes
- Fix security vulnerability - Fix watermark/copyright opacity wrong value #910
2 parents 6930248 + 2050859 commit f443420

File tree

3 files changed

+15
-6
lines changed

3 files changed

+15
-6
lines changed

classes/Visualizer/Gutenberg/Block.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,8 +750,12 @@ public function upload_csv_data( $data ) {
750750
return false;
751751
}
752752

753-
if ( $data['url'] && ! is_wp_error( $data['url'] ) && filter_var( $data['url'], FILTER_VALIDATE_URL ) ) {
754-
$source = new Visualizer_Source_Csv_Remote( $data['url'] );
753+
$remote_data = false;
754+
if ( isset( $data['url'] ) && function_exists( 'wp_http_validate_url' ) ) {
755+
$remote_data = wp_http_validate_url( $data['url'] );
756+
}
757+
if ( false !== $remote_data && ! is_wp_error( $remote_data ) ) {
758+
$source = new Visualizer_Source_Csv_Remote( $remote_data );
755759
if ( $source->fetch() ) {
756760
$temp = $source->getData();
757761
if ( is_string( $temp ) && is_array( unserialize( $temp ) ) ) {

classes/Visualizer/Module/Chart.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,10 +1111,15 @@ public function uploadData() {
11111111

11121112
$source = null;
11131113
$render = new Visualizer_Render_Page_Update();
1114-
if ( isset( $_POST['remote_data'] ) && filter_var( $_POST['remote_data'], FILTER_VALIDATE_URL ) ) {
1115-
$source = new Visualizer_Source_Csv_Remote( $_POST['remote_data'] );
1114+
1115+
$remote_data = false;
1116+
if ( isset( $_POST['remote_data'] ) && function_exists( 'wp_http_validate_url' ) ) {
1117+
$remote_data = wp_http_validate_url( $_POST['remote_data'] );
1118+
}
1119+
if ( false !== $remote_data ) {
1120+
$source = new Visualizer_Source_Csv_Remote( $remote_data );
11161121
if ( isset( $_POST['vz-import-time'] ) ) {
1117-
apply_filters( 'visualizer_pro_chart_schedule', $chart_id, $_POST['remote_data'], $_POST['vz-import-time'] );
1122+
apply_filters( 'visualizer_pro_chart_schedule', $chart_id, $remote_data, $_POST['vz-import-time'] );
11181123
}
11191124
// phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
11201125
} elseif ( isset( $_FILES['local_data'] ) && $_FILES['local_data']['error'] == 0 ) {

classes/Visualizer/Module/Frontend.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ public function renderChart( $atts ) {
477477
$prefix = 'T' . 'a' . 'bl' . 'e';
478478
}
479479
// return placeholder div
480-
return '<div class="' . $container_class . '">' . $actions_div . '<div id="' . $id . '"' . $this->getHtmlAttributes( $attributes ) . '></div>' . $this->addSchema( $chart->ID ) . ( ! Visualizer_Module::is_pro() ? ( '<' . 'di' . 'v st' . 'yl' . 'e="' . 'op' . 'a' . 'ci' . 't' . 'y:' . '0' . '.' . '.7' . ';t' . 'ex' . 't-a' . 'li' . 'gn:' . 'ri' . 'gh' . 't;b' . 'o' . 'tto' . 'm: 1' . '0px; z-i' . 'nd' . 'ex:1' . '00' . '0; ' . 'le' . 'ft' . ':2' . '0px' . '; fo' . 'nt-si' . 'ze: 1' . '4px">' . $prefix . ' b' . 'y' . ' <a ' . 'h' . 're' . 'f="ht' . 'tp' . 's:/' . '/t' . 'he' . 'me' . 'i' . 'sl' . 'e' . '.c' . 'om' . '/p' . 'lu' . 'gi' . 'ns' . '/v' . 'i' . 'su' . 'al' . 'iz' . 'er' . '-c' . 'ha' . 'rts' . '-a' . 'nd' . '-gr' . 'ap' . 'hs' . '/" t' . 'arg' . 'et="' . '_bl' . 'an' . 'k" re' . 'l=' . '"no' . 'fol' . 'l' . 'ow"' . '>V' . 'is' . 'u' . 'a' . 'l' . 'i' . 'z' . 'e' . 'r' . '</' . 'a' . '>' . '<' . '/' . 'd' . 'i' . 'v' . '>' ) : '' ) . '</div>';
480+
return '<div class="' . $container_class . '">' . $actions_div . '<div id="' . $id . '"' . $this->getHtmlAttributes( $attributes ) . '></div>' . $this->addSchema( $chart->ID ) . ( ! Visualizer_Module::is_pro() ? ( '<' . 'di' . 'v st' . 'yl' . 'e="' . 'op' . 'a' . 'ci' . 't' . 'y:' . '0' . '.7' . ';t' . 'ex' . 't-a' . 'li' . 'gn:' . 'ri' . 'gh' . 't;b' . 'o' . 'tto' . 'm: 1' . '0px; z-i' . 'nd' . 'ex:1' . '00' . '0; ' . 'le' . 'ft' . ':2' . '0px' . '; fo' . 'nt-si' . 'ze: 1' . '4px">' . $prefix . ' b' . 'y' . ' <a ' . 'h' . 're' . 'f="ht' . 'tp' . 's:/' . '/t' . 'he' . 'me' . 'i' . 'sl' . 'e' . '.c' . 'om' . '/p' . 'lu' . 'gi' . 'ns' . '/v' . 'i' . 'su' . 'al' . 'iz' . 'er' . '-c' . 'ha' . 'rts' . '-a' . 'nd' . '-gr' . 'ap' . 'hs' . '/" t' . 'arg' . 'et="' . '_bl' . 'an' . 'k" re' . 'l=' . '"no' . 'fol' . 'l' . 'ow"' . '>V' . 'is' . 'u' . 'a' . 'l' . 'i' . 'z' . 'e' . 'r' . '</' . 'a' . '>' . '<' . '/' . 'd' . 'i' . 'v' . '>' ) : '' ) . '</div>';
481481
}
482482

483483
/**

0 commit comments

Comments
 (0)