Making WordPress.org

Changeset 14880


Ignore:
Timestamp:
05/14/2026 08:42:11 AM (3 months ago)
Author:
dd32
Message:

Plugin Directory: Reapply [14874] which was accidentally reverted in [14879].

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-parser.php

    r14879 r14880  
    368368                }
    369369                if ( ! empty( $headers['license'] ) ) {
    370                         // Handle the many cases of "License: GPLv2 - http://..."
     370                        // Handle "License: GPLv2 - http://..." and wrapped forms like "<http://...>" or "(http://...)".
    371371                        if ( empty( $headers['license_uri'] ) && preg_match( '!(https?://\S+)!i', $headers['license'], $url ) ) {
    372                                 $headers['license_uri'] = trim( $url[1], " -*\t\n\r\n(" );
    373                                 $headers['license']     = trim( str_replace( $url[1], '', $headers['license'] ), " -*\t\n\r\n(" );
     372                                $headers['license_uri'] = trim( $url[1], " -*\t\n\r\n()<>" );
     373                                $headers['license']     = trim( str_replace( $url[1], '', $headers['license'] ), " -*\t\n\r\n()<>" );
    374374                        }
    375375
     
    647647                list( $key, $value ) = explode( ':', $line, 2 );
    648648                $key                 = strtolower( trim( $key, " \t*-\r\n" ) );
    649                 $value               = trim( $value, " \t*-\r\n" );
     649                // Strip `<>` so the markdown autolink form `<https://example.com>` resolves like a bare URL.
     650                $value               = trim( $value, " \t*-\r\n<>" );
    650651
    651652                if ( $only_valid && ! isset( $this->valid_headers[ $key ] ) ) {
Note: See TracChangeset for help on using the changeset viewer.