Skip to content

Commit 6ff9509

Browse files
Merge pull request #535 from contactashish13/issue-533
escape data before showing
2 parents 77c65ad + 7b96ea2 commit 6ff9509

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

classes/Visualizer/Render/Layout.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public static function _renderJsonScreen( $args ) {
154154
type="url"
155155
id="vz-import-json-url"
156156
name="url"
157-
value="<?php echo $url; ?>"
157+
value="<?php echo esc_url( $url ); ?>"
158158
placeholder="<?php esc_html_e( 'Please enter the URL', 'visualizer' ); ?>"
159159
class="visualizer-input">
160160
<button class="button button-secondary button-small" id="visualizer-json-fetch"><?php esc_html_e( 'Fetch Endpoint', 'visualizer' ); ?></button>
@@ -168,7 +168,7 @@ class="visualizer-input">
168168
<?php
169169
if ( ! empty( $root ) ) {
170170
?>
171-
<option value="<?php echo $root; ?>"><?php echo str_replace( Visualizer_Source_Json::TAG_SEPARATOR, Visualizer_Source_Json::TAG_SEPARATOR_VIEW, $root ); ?></option>
171+
<option value="<?php echo esc_attr( $root ); ?>"><?php echo str_replace( Visualizer_Source_Json::TAG_SEPARATOR, Visualizer_Source_Json::TAG_SEPARATOR_VIEW, $root ); ?></option>
172172
<?php
173173
}
174174
?>
@@ -187,7 +187,7 @@ class="visualizer-input">
187187
<?php
188188
if ( ! empty( $paging ) ) {
189189
?>
190-
<option value="<?php echo $paging; ?>"><?php echo sprintf( 'Get first %d pages using %s', apply_filters( 'visualizer_json_fetch_pages', 5, $url ), str_replace( Visualizer_Source_Json::TAG_SEPARATOR, Visualizer_Source_Json::TAG_SEPARATOR_VIEW, $paging ) ); ?></option>
190+
<option value="<?php echo esc_attr( $paging ); ?>"><?php echo sprintf( 'Get first %d pages using %s', apply_filters( 'visualizer_json_fetch_pages', 5, $url ), str_replace( Visualizer_Source_Json::TAG_SEPARATOR, Visualizer_Source_Json::TAG_SEPARATOR_VIEW, $paging ) ); ?></option>
191191
<?php
192192
}
193193
?>

classes/Visualizer/Render/Page/Data.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ protected function _renderSidebarContent() {
8989
$type = get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_CHART_TYPE, true );
9090
$lib = get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_CHART_LIBRARY, true );
9191
?>
92-
<span id="visualizer-chart-id" data-id="<?php echo $this->chart->ID; ?>" data-chart-source="<?php echo $source_of_chart; ?>" data-chart-type="<?php echo $type; ?>" data-chart-lib="<?php echo $lib; ?>"></span>
92+
<span id="visualizer-chart-id" data-id="<?php echo $this->chart->ID; ?>" data-chart-source="<?php echo esc_attr( $source_of_chart ); ?>" data-chart-type="<?php echo esc_attr( $type ); ?>" data-chart-lib="<?php echo esc_attr( $lib ); ?>"></span>
9393
<iframe id="thehole" name="thehole"></iframe>
9494
<ul class="viz-group-wrapper full-height">
9595
<li class="viz-group viz-group-category open" id="vz-chart-source">
@@ -149,7 +149,7 @@ class="dashicons dashicons-lock"></span></span>
149149
target="thehole" enctype="multipart/form-data">
150150
<div class="remote-file-section">
151151
<input type="url" id="vz-schedule-url" name="remote_data"
152-
value="<?php echo get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_CHART_URL, true ); ?>"
152+
value="<?php echo esc_url( get_post_meta( $this->chart->ID, Visualizer_Plugin::CF_CHART_URL, true ) ); ?>"
153153
placeholder="<?php esc_html_e( 'Please enter the URL of CSV file', 'visualizer' ); ?>"
154154
class="visualizer-input visualizer-remote-url">
155155
<p class="viz-group-description"><?php _e( 'How often do you want to check the url', 'visualizer' ); ?></p>

0 commit comments

Comments
 (0)