Skip to:
Content

BuddyPress.org

Changeset 8816


Ignore:
Timestamp:
08/12/2014 02:52:12 PM (7 years ago)
Author:
johnjamesjacoby
Message:

In BP_XProfile_Field_Type_URL::pre_validate_filter() fix bug disallowing the emptying of URL field types.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-xprofile/bp-xprofile-classes.php

    r8801 r8816  
    27882788     * @return string
    27892789     */
    2790     public static function pre_validate_filter( $submitted_value ) {
     2790    public static function pre_validate_filter( $submitted_value = '' ) {
     2791
     2792        // Allow empty URL values
     2793        if ( empty( $submitted_value ) ) {
     2794            return '';
     2795        }
     2796
     2797        // Run some checks on the submitted value
    27912798        if ( false === strpos( $submitted_value, ':'  )
    2792               && substr( $submitted_value, 0, 1 ) !== '/'
    2793                   && substr( $submitted_value, 0, 1 ) !== '#'
    2794           && ! preg_match( '/^[a-z0-9-]+?\.php/i', $submitted_value )
     2799             && substr( $submitted_value, 0, 1 ) !== '/'
     2800             && substr( $submitted_value, 0, 1 ) !== '#'
     2801             && ! preg_match( '/^[a-z0-9-]+?\.php/i', $submitted_value )
    27952802        ) {
    27962803            $submitted_value = 'http://' . $submitted_value;
Note: See TracChangeset for help on using the changeset viewer.