Make WordPress Core


Ignore:
Timestamp:
09/18/2019 11:37:08 PM (6 years ago)
Author:
whyisjake
Message:

Add SMS to the list of allowed protocols.

This commit expands the list of allowed protocols. It adds the sms:// which can be used to open meessaging clients for mobile users.

Props rilwis, kraftbj

Fixes #39415

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r46162 r46172  
    59845984 * @since 4.3.0 Added 'webcal' to the protocols array.
    59855985 * @since 4.7.0 Added 'urn' to the protocols array.
     5986 * @since 5.3.0 Added 'sms' to the protocols array.
    59865987 *
    59875988 * @see wp_kses()
     
    59925993 * @return string[] Array of allowed protocols. Defaults to an array containing 'http', 'https',
    59935994 *                  'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet',
    5994  *                  'mms', 'rtsp', 'svn', 'tel', 'fax', 'xmpp', 'webcal', and 'urn'. This covers
    5995  *                  all common link protocols, except for 'javascript' which should not be
    5996  *                  allowed for untrusted users.
     5995 *                  'mms', 'rtsp', 'sms', 'svn', 'tel', 'fax', 'xmpp', 'webcal', and 'urn'.
     5996 *                  This covers all common link protocols, except for 'javascript' which should not
     5997 *                  be allowed for untrusted users.
    59975998 */
    59985999function wp_allowed_protocols() {
     
    60006001
    60016002    if ( empty( $protocols ) ) {
    6002         $protocols = array( 'http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'svn', 'tel', 'fax', 'xmpp', 'webcal', 'urn' );
     6003        $protocols = array( 'http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'sms', 'svn', 'tel', 'fax', 'xmpp', 'webcal', 'urn' );
    60036004    }
    60046005
Note: See TracChangeset for help on using the changeset viewer.