Changeset 5205 for sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-parser.php
- Timestamp:
- 03/30/2017 05:57:41 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
r5195 r5205 319 319 $this->sections = array_filter( $this->sections ); 320 320 321 // Use the first line of the description for the short description if not provided.322 if ( empty( $this->short_description ) && ! empty( $this->sections['description'] ) ) {323 $this->short_description = array_filter( explode( "\n", $this->sections['description'] ) )[0];324 }325 326 321 // Use the short description for the description section if not provided. 327 322 if ( empty( $this->sections['description'] ) ) { … … 352 347 $this->upgrade_notice = array_map( array( $this, 'parse_markdown' ), $this->upgrade_notice ); 353 348 $this->faq = array_map( array( $this, 'parse_markdown' ), $this->faq ); 349 350 // Use the first line of the description for the short description if not provided. 351 if ( ! $this->short_description && ! empty( $this->sections['description'] ) ) { 352 $this->short_description = array_filter( explode( "\n", $this->sections['description'] ) )[0]; 353 } 354 354 355 355 // Sanitize and trim the short_description to match requirements. … … 576 576 $heading_style = 'bold'; // 'heading' or 'bold' 577 577 foreach ( $trimmed_lines as $trimmed ) { 578 if ( $trimmed [0] == '#' || $trimmed[0] == '=') {578 if ( $trimmed && ( $trimmed[0] == '#' || $trimmed[0] == '=' ) ) { 579 579 $heading_style = 'heading'; 580 580 break;
Note: See TracChangeset
for help on using the changeset viewer.