Changeset 4196 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-parser.php
- Timestamp:
- 10/07/2016 04:35:28 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-parser.php
r4194 r4196 489 489 protected function sanitize_contributors( $users ) { 490 490 foreach ( $users as $i => $name ) { 491 if ( $user = get_user_by( 'login', $name ) ) { 492 493 // Check the case of the user login matches. 494 if ( $name !== $user->user_login ) { 495 $users[ $i ] = $user->user_login; 496 } 497 } elseif ( false !== ( $user = get_user_by( 'slug', $name ) ) ) { 498 499 // Overwrite the nicename with the user_login. 500 $users[ $i ] = $user->user_login; 501 } else { 502 503 // Unknown user, we'll skip these entirely to encourage correct readme files. 491 // Contributors should be listed by their WordPress.org Login name (Example: 'Joe Bloggs') 492 $user = get_user_by( 'login', $name ); 493 494 // Or failing that, by their user_nicename field (Example: 'joe-bloggs') 495 if ( ! $user ) { 496 $user = get_user_by( 'slug', $name ); 497 } 498 499 // In the event that something invalid is used, we'll ignore it (Example: 'Joe Bloggs (Australian Translation)') 500 if ( ! $user ) { 504 501 unset( $users[ $i ] ); 505 } 502 continue; 503 } 504 505 // Overwrite whatever the author has specified with the sanitized nicename. 506 $users[ $i ] = $user->user_nicename; 506 507 } 507 508
Note: See TracChangeset
for help on using the changeset viewer.