Make WordPress Core


Ignore:
Timestamp:
06/28/2012 08:30:10 PM (14 years ago)
Author:
markjaquith
Message:

Allow tel: and fax: protocols. Wrangle the last hardcoded protocol enumeration so that it uses wp_allowed_protocols(). fixes #21081

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/user.php

    r20739 r21170  
    7070        } else {
    7171            $user->user_url = esc_url_raw( $_POST['url'] );
    72             $user->user_url = preg_match('/^(https?|ftps?|mailto|news|irc|gopher|nntp|feed|telnet):/is', $user->user_url) ? $user->user_url : 'http://'.$user->user_url;
     72            $protocols = implode( '|', array_map( 'preg_quote', wp_allowed_protocols() ) );
     73            $user->user_url = preg_match('/^(' . $protocols . '):/is', $user->user_url) ? $user->user_url : 'http://'.$user->user_url;
    7374        }
    7475    }
Note: See TracChangeset for help on using the changeset viewer.