Skip to content

Commit

Permalink
fix: Shop url rendered double slash when using WPML on vendor registr…
Browse files Browse the repository at this point in the history
…ation form. (getdokan#2291)

* fix: Shop url rendered double slash when using WPML on vendor registration form.

* fix: phpcs issue.

* add: Used escaping function before shop url redered.

* add: Used escaping function before shop url rendered on seller registration form.
  • Loading branch information
MdAsifHossainNadim committed Jul 8, 2024
1 parent 64fcc7d commit 42c5839
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
10 changes: 8 additions & 2 deletions templates/account/update-customer-to-vendor.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
* @var string $phone
* @var string $toc_page_id
*/

$home_url = untrailingslashit( home_url() );
$custom_store_url = dokan_get_option( 'custom_store_url', 'dokan_general', 'store' );
?>

<h2><?php esc_html_e( 'Update account to Vendor', 'dokan-lite' ); ?></h2>
Expand All @@ -38,7 +41,10 @@
<label for="seller-url" class="pull-left"><?php esc_html_e( 'Shop URL', 'dokan-lite' ); ?> <span class="required">*</span></label>
<strong id="url-alart-mgs" class="pull-right"></strong>
<input type="text" class="input-text form-control" name="shopurl" id="seller-url" value="<?php echo esc_attr( $shop_url ); ?>" required="required" />
<small><?php echo home_url() . '/' . dokan_get_option( 'custom_store_url', 'dokan_general', 'store' ); ?>/<strong id="url-alart"></strong></small>
<small>
<?php echo esc_url( $home_url . '/' . $custom_store_url ) . '/'; ?>
<strong id="url-alart"></strong>
</small>
</p>

<p class="form-row form-group form-row-wide">
Expand All @@ -63,7 +69,7 @@
<?php
$tc_link = sprintf( '<a target="_blank" href="%1$s">%2$s</a>', esc_url( $toc_page_url ), __( 'Terms &amp; Conditions', 'dokan-lite' ) );
// translators: 1. Terms and conditions of agreement link.
echo sprintf( __( 'I have read and agree to the %1$s.', 'dokan-lite' ), $tc_link );
printf( __( 'I have read and agree to the %1$s.', 'dokan-lite' ), $tc_link );
?>
</label>
</p>
Expand Down
8 changes: 7 additions & 1 deletion templates/global/seller-registration-form.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
*
* @since 2.4
*/

$home_url = untrailingslashit( home_url() );
$custom_store_url = dokan_get_option( 'custom_store_url', 'dokan_general', 'store' );
?>

<div class="show_if_seller" style="<?php echo esc_attr( $role_style ); ?>">
Expand All @@ -29,7 +32,10 @@
<label for="seller-url" class="pull-left"><?php esc_html_e( 'Shop URL', 'dokan-lite' ); ?> <span class="required">*</span></label>
<strong id="url-alart-mgs" class="pull-right"></strong>
<input type="text" class="input-text form-control" name="shopurl" id="seller-url" value="<?php echo ! empty( $data['shopurl'] ) ? esc_attr( $data['shopurl'] ) : ''; ?>" required="required" />
<small><?php echo esc_url( home_url() . '/' . dokan_get_option( 'custom_store_url', 'dokan_general', 'store' ) ); ?>/<strong id="url-alart"></strong></small>
<small>
<?php echo esc_url( $home_url . '/' . $custom_store_url ) . '/'; ?>
<strong id="url-alart"></strong>
</small>
</p>

<?php
Expand Down

0 comments on commit 42c5839

Please sign in to comment.