Ticket #39415: 39415.3.diff
| File 39415.3.diff, 2.3 KB (added by , 6 years ago) |
|---|
-
src/wp-includes/functions.php
5983 5983 * @since 3.3.0 5984 5984 * @since 4.3.0 Added 'webcal' to the protocols array. 5985 5985 * @since 4.7.0 Added 'urn' to the protocols array. 5986 * @since 5.3.0 Added 'sms' to the protocols array. 5986 5987 * 5987 5988 * @see wp_kses() 5988 5989 * @see esc_url() … … 5991 5992 * 5992 5993 * @return string[] Array of allowed protocols. Defaults to an array containing 'http', 'https', 5993 5994 * 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 5994 * 'mms', 'rtsp', 's vn', 'tel', 'fax', 'xmpp', 'webcal', and 'urn'. This covers5995 * all common link protocols, except for 'javascript' which should not be5996 * 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. 5997 5998 */ 5998 5999 function wp_allowed_protocols() { 5999 6000 static $protocols = array(); 6000 6001 6001 6002 if ( empty( $protocols ) ) { 6002 $protocols = array( 'http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 's vn', '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' ); 6003 6004 } 6004 6005 6005 6006 if ( ! did_action( 'wp_loaded' ) ) { -
tests/phpunit/tests/functions/allowedProtocols.php
53 53 array( 'rtsp', 'rtsp://media.example.com:554/wordpress/audiotrack' ), // RFC2326 54 54 array( 'svn', 'svn://core.svn.wordpress.org/' ), 55 55 array( 'tel', 'tel:+1-234-567-8910' ), // RFC3966 56 array( 'sms', 'sms:+1-234-567-8910' ), // RFC3966 56 57 array( 'fax', 'fax:+123.456.78910' ), // RFC2806/RFC3966 57 58 array( 'xmpp', 'xmpp://guest@example.com' ), // RFC5122 58 59 array( 'webcal', 'webcal://example.com/calendar.ics' ),