Update 'ultimatemember_searchform' shortcode in Ultimate Member plugin

Refactored template, CSS and JS to fix the security vulnerability.
This commit is contained in:
Mykyta Synelnikov
2026-01-28 11:52:06 +02:00
parent fd44b978cf
commit 9ba4e4b8d4
9 changed files with 126 additions and 83 deletions
+8 -13
View File
@@ -6,23 +6,18 @@
*
* Call: function ultimatemember_searchform()
*
* @version 2.6.1
* @version 2.11.2
*
* @var string $members_page
* @var string $search_value
* @var array $query
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
} ?>
<div class="search-form um-search-form" data-members_page="<?php echo esc_url( $members_page ); ?>">
<?php foreach ( array_keys( $query ) as $key ) { ?>
<input type="hidden" name="um-search-keys[]" value="<?php echo esc_attr( $key ) ?>" />
<?php } ?>
<div class="um-search-area">
<span class="screen-reader-text"><?php echo _x( 'Search for:', 'label' ); ?></span>
<input type="search" class="um-search-field search-field" placeholder="<?php echo esc_attr_x( 'Search &hellip;', 'placeholder' ); ?>" value="<?php echo esc_attr( $search_value ); ?>" name="search" title="<?php echo esc_attr_x( 'Search for:', 'label' ); ?>" />
<a href="javascript:void(0);" id="um-search-button" class="um-search-icon um-faicon um-faicon-search"></a>
}
?>
<div class="um search-form um-search-form" data-nonce="<?php echo esc_attr( wp_create_nonce( 'um_search_widget_request' ) ); ?>">
<div class="um-form um-search-area">
<span class="screen-reader-text"><?php echo esc_html_x( 'Search for:', 'label', 'ultimate-member' ); ?></span>
<input type="search" class="um-search-field search-field" placeholder="<?php echo esc_attr_x( 'Search &hellip;', 'placeholder', 'ultimate-member' ); ?>" value="<?php echo esc_attr( $search_value ); ?>" name="search" title="<?php echo esc_attr_x( 'Search for:', 'label', 'ultimate-member' ); ?>" />
<a href="#" id="um-search-button" class="um-search-icon um-faicon um-faicon-search"></a>
</div>
</div>