Skip to:
Content

BuddyPress.org

Changeset 2547


Ignore:
Timestamp:
02/02/2010 09:42:06 PM (15 years ago)
Author:
apeatling
Message:

Fixing checks for spaces in values.

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity.php

    r2542 r2547  
    562562    extract( $r, EXTR_SKIP );
    563563
    564     if ( empty( $content ) )
     564    if ( empty( $content ) || !strlen( trim( $content ) ) )
    565565        return false;
    566566
  • trunk/bp-forums.php

    r2533 r2547  
    443443        $post_position = $post->post_position;
    444444
    445     $post = bb_insert_post( array( 'post_id' => $post_id, 'topic_id' => $topic_id, 'post_text' => stripslashes( $post_text ), 'post_time' => $post_time, 'poster_id' => $poster_id, 'poster_ip' => $poster_ip, 'post_status' => $post_status, 'post_position' => $post_position ) );
     445    $post = bb_insert_post( array( 'post_id' => $post_id, 'topic_id' => $topic_id, 'post_text' => stripslashes( trim( $post_text ) ), 'post_time' => $post_time, 'poster_id' => $poster_id, 'poster_ip' => $poster_ip, 'post_status' => $post_status, 'post_position' => $post_position ) );
    446446
    447447    if ( $post )
  • trunk/bp-groups.php

    r2538 r2547  
    10521052
    10531053        if ( 'group-details' == $bp->groups->current_create_step ) {
    1054             if ( empty( $_POST['group-name'] ) || empty( $_POST['group-desc'] ) ) {
     1054            if ( empty( $_POST['group-name'] ) || empty( $_POST['group-desc'] ) || !strlen( trim( $_POST['group-name'] ) ) || !strlen( trim( $_POST['group-desc'] ) ) ) {
    10551055                bp_core_add_message( __( 'Please fill in all of the required fields', 'buddypress' ), 'error' );
    10561056                bp_core_redirect( $bp->root_domain . '/' . $bp->groups->slug . '/create/step/' . $bp->groups->current_create_step . '/' );
     
    18561856    extract( $r, EXTR_SKIP );
    18571857
    1858     if ( empty($content) || empty($user_id) || empty($group_id) )
     1858    if ( empty($content) || !strlen( trim( $content ) ) || empty($user_id) || empty($group_id) )
    18591859        return false;
    18601860
  • trunk/bp-xprofile.php

    r2493 r2547  
    719719        return false;
    720720
     721    if ( empty( $value ) || !strlen( trim( $value ) ) )
     722        return false;
     723
    721724    $field = new BP_XProfile_ProfileData();
    722725    $field->field_id = $field_id;
  • trunk/bp-xprofile/bp-xprofile-classes.php

    r2439 r2547  
    728728
    729729        if ( $this->is_valid_field() ) {
    730             if ( $this->exists() && $this->value != '' ) {
     730            if ( $this->exists() && !empty( $this->value ) && strlen( trim( $this->value ) ) ) {
    731731                $result = $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_data} SET value = %s, last_updated = %s WHERE user_id = %d AND field_id = %d", $this->value, $this->last_updated, $this->user_id, $this->field_id ) );
    732732            } else if ( $this->exists() && empty( $this->value ) ) {
Note: See TracChangeset for help on using the changeset viewer.