Changeset 8794
- Timestamp:
- 05/15/2019 06:32:48 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-upload.php
r8789 r8794 93 93 'requires' => 'requires at least', 94 94 'requires_php' => 'requires php', 95 'readme_tags' => 'tags',96 95 'contributors' => 'contributors', 97 96 'license' => 'license', … … 434 433 if ( ! $data['contributors'] ) { 435 434 unset( $data['contributors'] ); 435 } 436 } 437 438 // Sanitize some version-like data. 439 foreach ( array( 'requires', 'requires_php', 'tested' ) as $field ) { 440 if ( ! isset( $data[ $field ] ) ) { 441 continue; 442 } 443 444 // Strip 'WP', 'WordPress', and 'PHP' from the fields. 445 $data[ $field ] = trim( str_ireplace( array( 'PHP', 'WP', 'WordPress', '+' ), '', $data[ $field ] ) ); 446 447 // Require a version-like value, x.y or x.y.z 448 if ( ! preg_match( '!^\d+\.\d(\.\d+)?$!', $data[ $field ] ) ) { 449 unset( $data[ $field ] ); 450 continue; 451 } 452 453 // Allow themes to mark themselves as compatible with Stable+0.1 (trunk/master) but not higher 454 if ( 455 ( 'requires' === $field || 'tested' === $field ) && 456 defined( 'WP_CORE_STABLE_BRANCH' ) && 457 version_compare( (float)$data[ $field ], (float)WP_CORE_STABLE_BRANCH+0.1, '>' ) 458 ) { 459 unset( $data[ $field ] ); 460 continue; 436 461 } 437 462 }
Note: See TracChangeset
for help on using the changeset viewer.