Changeset 2638 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-tools.php
- Timestamp:
- 02/26/2016 02:26:25 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-tools.php
r2621 r2638 8 8 */ 9 9 class Tools { 10 11 /**12 * @param string $readme13 * @return object14 */15 static function get_readme_data( $readme ) {16 17 // Uses https://github.com/rmccue/WordPress-Readme-Parser (with modifications)18 include_once __DIR__ . '/readme-parser/markdown.php';19 include_once __DIR__ . '/readme-parser/compat.php';20 21 $data = (object) \WPorg_Readme::parse_readme( $readme );22 23 unset( $data->sections['screenshots'] ); // Useless.24 25 // Sanitize contributors.26 foreach ( $data->contributors as $i => $name ) {27 if ( get_user_by( 'login', $name ) ) {28 continue;29 } elseif ( false !== ( $user = get_user_by( 'slug', $name ) ) ) {30 $data->contributors[] = $user->user_login;31 unset( $data->contributors[ $i ] );32 } else {33 unset( $data->contributors[ $i ] );34 }35 }36 37 return $data;38 }39 10 40 11 /**
Note: See TracChangeset
for help on using the changeset viewer.