Make WordPress Core


Ignore:
Timestamp:
11/17/2023 01:27:23 PM (2 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve some DocBlocks and inline comments per the documentation standards.

Follow-up to [56834], [56836], [56837], [56838].

Props kebbet, costdev, mukesh27, SergeyBiryukov.
See #59651.

File:
1 edited

Legend:

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

    r56837 r57120  
    639639 * @since 5.6.0
    640640 * @since 6.2.0 Allow insecure HTTP connections for the local environment.
    641  * @since 6.3.2 Validates the success and reject URLs to prevent javascript pseudo protocol being executed.
     641 * @since 6.3.2 Validates the success and reject URLs to prevent `javascript` pseudo protocol from being executed.
    642642 *
    643643 * @param array   $request {
     
    701701
    702702/**
    703  * Validates the redirect URL protocol scheme. The protocol can be anything except http and javascript.
     703 * Validates the redirect URL protocol scheme. The protocol can be anything except `http` and `javascript`.
    704704 *
    705705 * @since 6.3.2
    706706 *
    707  * @param string $url - The redirect URL to be validated.
    708  *
     707 * @param string $url The redirect URL to be validated.
    709708 * @return true|WP_Error True if the redirect URL is valid, a WP_Error object otherwise.
    710709 */
     
    729728     * @since 6.3.2
    730729     *
    731      * @param string[]  $bad_protocols Array of invalid protocols.
    732      * @param string    $url The redirect URL to be validated.
     730     * @param string[] $bad_protocols Array of invalid protocols.
     731     * @param string   $url The redirect URL to be validated.
    733732     */
    734     $invalid_protocols = array_map( 'strtolower', apply_filters( 'wp_authorize_application_redirect_url_invalid_protocols', $bad_protocols, $url ) );
     733    $invalid_protocols = apply_filters( 'wp_authorize_application_redirect_url_invalid_protocols', $bad_protocols, $url );
     734    $invalid_protocols = array_map( 'strtolower', $invalid_protocols );
    735735
    736736    $scheme   = wp_parse_url( $url, PHP_URL_SCHEME );
     
    738738    $is_local = 'local' === wp_get_environment_type();
    739739
    740     // validates if the proper URI format is applied to the $url
     740    // Validates if the proper URI format is applied to the URL.
    741741    if ( empty( $host ) || empty( $scheme ) || in_array( strtolower( $scheme ), $invalid_protocols, true ) ) {
    742742        return new WP_Error(
Note: See TracChangeset for help on using the changeset viewer.