Changeset 14880
- Timestamp:
- 05/14/2026 08:42:11 AM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-parser.php
r14879 r14880 368 368 } 369 369 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://...)". 371 371 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()<>" ); 374 374 } 375 375 … … 647 647 list( $key, $value ) = explode( ':', $line, 2 ); 648 648 $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<>" ); 650 651 651 652 if ( $only_valid && ! isset( $this->valid_headers[ $key ] ) ) {
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)