Escape import variables ( issue with greet() function )

This commit is contained in:
Savvas Hadjigeorgiou
2021-11-12 08:01:30 +02:00
parent f5aae77471
commit bec7a43b42
7 changed files with 33 additions and 33 deletions

View File

@@ -164,7 +164,7 @@ if ( class_exists( 'WP_Importer' ) ) {
// Show Result
echo '<div class="updated settings-error below-h2"><p>
' . sprintf( __( 'Import complete - imported <strong>%1$s</strong> staff and skipped <strong>%2$s</strong>.', 'sportspress' ), $this->imported, $this->skipped ) . '
' . sprintf( esc_html__( 'Import complete - imported <strong>%1$s</strong> staff and skipped <strong>%2$s</strong>.', 'sportspress' ), esc_html( $this->imported ), esc_html( $this->skipped ) ) . '
</p></div>';
$this->import_end();
@@ -174,7 +174,7 @@ if ( class_exists( 'WP_Importer' ) ) {
* Performs post-import cleanup of files and the cache
*/
function import_end() {
echo '<p>' . __( 'All done!', 'sportspress' ) . ' <a href="' . admin_url( 'edit.php?post_type=sp_staff' ) . '">' . __( 'View Staff', 'sportspress' ) . '</a>' . '</p>';
echo '<p>' . esc_html__( 'All done!', 'sportspress' ) . ' <a href="' . esc_url( admin_url( 'edit.php?post_type=sp_staff' ) ) . '">' . esc_html__( 'View Staff', 'sportspress' ) . '</a>' . '</p>';
do_action( 'import_end' );
}
@@ -186,7 +186,7 @@ if ( class_exists( 'WP_Importer' ) ) {
* @return void
*/
function header() {
echo '<div class="wrap"><h2>' . __( 'Import Staff', 'sportspress' ) . '</h2>';
echo '<div class="wrap"><h2>' . esc_html__( 'Import Staff', 'sportspress' ) . '</h2>';
}
/**
@@ -197,8 +197,8 @@ if ( class_exists( 'WP_Importer' ) ) {
*/
function greet() {
echo '<div class="narrow">';
echo '<p>' . __( 'Hi there! Choose a .csv file to upload, then click "Upload file and import".', 'sportspress' ) . '</p>';
echo '<p>' . sprintf( __( 'Staff need to be defined with columns in a specific order (6 columns). <a href="%s">Click here to download a sample</a>.', 'sportspress' ), plugin_dir_url( SP_PLUGIN_FILE ) . 'dummy-data/staff-sample.csv' ) . '</p>';
echo '<p>' . esc_html__( 'Hi there! Choose a .csv file to upload, then click "Upload file and import".', 'sportspress' ) . '</p>';
echo '<p>' . sprintf( __( 'Staff need to be defined with columns in a specific order (6 columns). <a href="%s">Click here to download a sample</a>.', 'sportspress' ), esc_url( plugin_dir_url( SP_PLUGIN_FILE ) ) . 'dummy-data/staff-sample.csv' ) . '</p>';
wp_import_upload_form( 'admin.php?import=sp_staff_csv&step=1' );
echo '</div>';
}
@@ -218,7 +218,7 @@ if ( class_exists( 'WP_Importer' ) ) {
<label>
<input type="hidden" name="merge" value="0">
<input type="checkbox" name="merge" value="1" checked="checked">
<?php _e( 'Merge duplicates', 'sportspress' ); ?>
<?php esc_html_e( 'Merge duplicates', 'sportspress' ); ?>
</label>
</td>
</tr>