Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
12/04/2010 11:41:28 PM (14 years ago)
Author:
djpaul
Message:

Fix double-escaping of search string when performing search from the site-wide search box. Partially addresses #2776.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-blogs/bp-blogs-templatetags.php

    r3481 r3511  
    503503
    504504function bp_directory_blogs_search_form() {
    505     global $bp; ?>
     505    global $bp;
     506
     507    $search_value = __( 'Search anything...', 'buddypress' );
     508    if ( !empty( $_GET['s'] ) )
     509        $search_value = stripslashes( $_GET['s'] );
     510
     511    ?>
    506512    <form action="" method="get" id="search-blogs-form">
    507         <label><input type="text" name="s" id="blogs_search" value="<?php if ( isset( $_GET['s'] ) ) { echo $_GET['s']; } else { _e( 'Search anything...', 'buddypress' ); } ?>"  onfocus="if (this.value == '<?php _e( 'Search anything...', 'buddypress' ) ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e( 'Search anything...', 'buddypress' ) ?>';}" /></label>
     513        <label><input type="text" name="s" id="blogs_search" value="<?php echo esc_attr( $search_value ) ?>"  onfocus="if (this.value == '<?php _e( 'Search anything...', 'buddypress' ) ?>') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php _e( 'Search anything...', 'buddypress' ) ?>';}" /></label>
    508514        <input type="submit" id="blogs_search_submit" name="blogs_search_submit" value="<?php _e( 'Search', 'buddypress' ) ?>" />
    509515    </form>
Note: See TracChangeset for help on using the changeset viewer.