Make WordPress Core

Ticket #55852: 55852.diff

File 55852.diff, 1.5 KB (added by benjgrolleau, 2 years ago)
  • src/wp-includes/formatting.php

    diff --git a/src/wp-includes/formatting.php b/src/wp-includes/formatting.php
    index 06e0f26aae..37430aa517 100644
    a b function esc_url( $url, $protocols = null, $_context = 'display' ) { 
    44624462 *
    44634463 * @since 2.8.0
    44644464 *
    4465  * @see esc_url()
     4465 * @see sanitize_url()
    44664466 *
    44674467 * @param string   $url       The URL to be cleaned.
    44684468 * @param string[] $protocols Optional. An array of acceptable protocols.
    44694469 *                            Defaults to return value of wp_allowed_protocols().
    4470  * @return string The cleaned URL after esc_url() is run with the 'db' context.
     4470 * @return string The cleaned URL after sanitize_url() is run with the 'db' context.
    44714471 */
    44724472function esc_url_raw( $url, $protocols = null ) {
    4473         return esc_url( $url, $protocols, 'db' );
     4473        return sanitize_url( $url, $protocols );
    44744474}
    44754475
    44764476/**
    function esc_url_raw( $url, $protocols = null ) { 
    44824482 * @since 2.8.0 Deprecated in favor of esc_url_raw().
    44834483 * @since 5.9.0 Restored (un-deprecated).
    44844484 *
    4485  * @see esc_url_raw()
     4485 * @see esc_url()
    44864486 *
    44874487 * @param string   $url       The URL to be cleaned.
    44884488 * @param string[] $protocols Optional. An array of acceptable protocols.
    function esc_url_raw( $url, $protocols = null ) { 
    44904490 * @return string The cleaned URL after esc_url() is run with the 'db' context.
    44914491 */
    44924492function sanitize_url( $url, $protocols = null ) {
    4493         return esc_url_raw( $url, $protocols );
     4493        return esc_url( $url, $protocols, 'db' );
    44944494}
    44954495
    44964496/**