WordPress.org

Make WordPress Core

Ticket #39415: 39415.patch

File 39415.patch, 1.7 KB (added by keraweb, 9 months ago)

Added 'skype' and 'sms' to the protocols array.

  • wp-includes/functions.php

     
    1 <?php
     1<?php
    22/**
    33 * Main WordPress API
    44 *
     
    56955695 * @since 3.3.0
    56965696 * @since 4.3.0 Added 'webcal' to the protocols array.
    56975697 * @since 4.7.0 Added 'urn' to the protocols array.
     5698 * @since 5.x.x Added 'skype' and 'sms' to the protocols array.
    56985699 *
    56995700 * @see wp_kses()
    57005701 * @see esc_url()
     
    57035704 *
    57045705 * @return string[] Array of allowed protocols. Defaults to an array containing 'http', 'https',
    57055706 *                  'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet',
    5706  *                  'mms', 'rtsp', 'svn', 'tel', 'fax', 'xmpp', 'webcal', and 'urn'. This covers
    5707  *                  all common link protocols, except for 'javascript' which should not be
    5708  *                  allowed for untrusted users.
     5707 *                  'mms', 'rtsp', 'skype', 'sms', 'svn', 'tel', 'fax', 'xmpp', 'webcal', and 'urn'.
     5708 *                  This covers all common link protocols, except for 'javascript' which should not
     5709 *                  be allowed for untrusted users.
    57095710 */
    57105711function wp_allowed_protocols() {
    57115712        static $protocols = array();
    57125713
    57135714        if ( empty( $protocols ) ) {
    5714                 $protocols = array( 'http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'svn', 'tel', 'fax', 'xmpp', 'webcal', 'urn' );
     5715                $protocols = array( 'http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'skype', 'sms', 'svn', 'tel', 'fax', 'xmpp', 'webcal', 'urn' );
    57155716        }
    57165717
    57175718        if ( ! did_action( 'wp_loaded' ) ) {