Skip to:
Content

BuddyPress.org

Changeset 13898


Ignore:
Timestamp:
06/02/2024 05:55:08 PM (2 years ago)
Author:
espellcaste
Message:

Use wp_parse_url instead of parse_url to parse URLs.

Props imath
Closes https://github.com/buddypress/buddypress/pull/307
See #7228

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-core/bp-core-functions.php

    r13893 r13898  
    23982398        // Parse home_url() into pieces to remove query-strings, strange characters,
    23992399        // and other funny things that plugins might to do to it.
    2400         $parsed_home = parse_url( home_url( '/', ( is_ssl() ? 'https' : 'http' ) ) );
     2400        $parsed_home = wp_parse_url( home_url( '/', ( is_ssl() ? 'https' : 'http' ) ) );
    24012401
    24022402        // Maybe include the port, if it's included in home_url().
  • trunk/src/bp-core/classes/class-bp-media-extractor.php

    r13897 r13898  
    631631                        }
    632632
    633                         $path = untrailingslashit( parse_url( $audio['attributes'][ $src_param ], PHP_URL_PATH ) );
     633                        $path = untrailingslashit( wp_parse_url( $audio['attributes'][ $src_param ], PHP_URL_PATH ) );
    634634
    635635                        foreach ( $audio_types as $extension ) {
     
    728728                        }
    729729
    730                         $path = untrailingslashit( parse_url( $video['attributes'][ $src_param ], PHP_URL_PATH ) );
     730                        $path = untrailingslashit( wp_parse_url( $video['attributes'][ $src_param ], PHP_URL_PATH ) );
    731731
    732732                        foreach ( $video_types as $extension ) {
  • trunk/src/bp-templates/bp-nouveau/buddypress-functions.php

    r13878 r13898  
    706706                }
    707707
    708                 $uri = parse_url( $path );
     708                $uri = wp_parse_url( $path );
    709709
    710710                if ( false === strpos( $uri['path'], 'customize.php' ) ) {
  • trunk/src/bp-templates/bp-nouveau/includes/messages/functions.php

    r13481 r13898  
    158158                        'more' => __( '(and %d others)', 'buddypress' ),
    159159                ),
    160                 'rootUrl'           => parse_url( $root_url, PHP_URL_PATH ),
     160                'rootUrl'           => wp_parse_url( $root_url, PHP_URL_PATH ),
    161161                'supportedRoutes'   => $routes,
    162162        );
  • trunk/src/bp-xprofile/classes/class-bp-xprofile-field-type-telephone.php

    r13806 r13898  
    140140        public static function display_filter( $field_value, $field_id = '' ) {
    141141                $url   = wp_strip_all_tags( $field_value );
    142                 $parts = parse_url( $url );
     142                $parts = wp_parse_url( $url );
    143143
    144144                // Add the tel:// protocol to the field value.
  • trunk/tests/phpunit/testcases/core/functions/bpVerifyNonceRequest.php

    r13314 r13898  
    7575         */
    7676        public function add_port_and_subdirectory_to_home_url( $url, $path, $scheme ) {
    77                 $home = parse_url( get_option( 'home' ) );
     77                $home = wp_parse_url( get_option( 'home' ) );
    7878                $home_path = isset( $home['path'] ) ? $home['path'] : '';
    7979                return $scheme . '://' . $home['host'] . ':80' . $home_path . '/wordpress' . $path;
Note: See TracChangeset for help on using the changeset viewer.