| @@ -1110,12 +1110,17 @@ | ||
| 1110 | 1110 | delete_post_meta( $chart_id, Visualizer_Plugin::CF_EDITABLE_TABLE ); |
| 1111 | 1111 | |
| 1112 | 1112 | $source = null; |
| 1113 | 1113 | $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 ); | |
| 1116 | 1121 | 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'] ); | |
| 1118 | 1123 | } |
| 1119 | 1124 | // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison |
| 1120 | 1125 | } elseif ( isset( $_FILES['local_data'] ) && $_FILES['local_data']['error'] == 0 ) { |
| 1121 | 1126 | $source = new Visualizer_Source_Csv( $_FILES['local_data']['tmp_name'] ); |