Changeset 10355 for trunk/src/bp-core/classes/class-bp-media-extractor.php
- Timestamp:
- 11/15/2015 07:13:42 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/classes/class-bp-media-extractor.php
r10160 r10355 63 63 * @param int $what_to_extract Media type to extract (optional). 64 64 * @param array $extra_args Bespoke data for a particular extractor (optional). 65 *66 65 * @return array { 67 66 * @type array $has Extracted media counts. { … … 197 196 * @param string $plaintext Sanitized version of the content. 198 197 * @param array $extra_args Bespoke data for a particular extractor (optional). 199 *200 198 * @return array { 201 199 * @type array $has Extracted media counts. { … … 212 210 $data = array( 'has' => array( 'links' => 0 ), 'links' => array() ); 213 211 214 // Matches: href="text" and href='text' 212 // Matches: href="text" and href='text'. 215 213 if ( stripos( $richtext, 'href=' ) !== false ) { 216 214 preg_match_all( '#href=(["\'])([^"\']+)\1#i', $richtext, $matches ); … … 257 255 * @param string $plaintext Sanitized version of the content. 258 256 * @param array $extra_args Bespoke data for a particular extractor. 259 *260 257 * @return array { 261 258 * @type array $has Extracted media counts. { … … 292 289 } 293 290 294 // Build results 291 // Build results. 295 292 foreach ( $mentions as $user_id => $mention_name ) { 296 293 $mention = array( 'name' => strtolower( $mention_name ) ); … … 329 326 * @param string $plaintext Sanitized version of the content. 330 327 * @param array $extra_args Bespoke data for a particular extractor (optional). 331 *332 328 * @return array { 333 329 * @type array $has Extracted media counts. { … … 354 350 // `<img src>` tags. 355 351 if ( stripos( $richtext, 'src=' ) !== false ) { 356 preg_match_all( '#src=(["\'])([^"\']+)\1#i', $richtext, $img_srcs ); // matches src="text" and src='text'352 preg_match_all( '#src=(["\'])([^"\']+)\1#i', $richtext, $img_srcs ); // Matches src="text" and src='text'. 357 353 358 354 // <img>. … … 449 445 * @param string $plaintext Sanitized version of the content. 450 446 * @param array $extra_args Bespoke data for a particular extractor (optional). 451 *452 447 * @return array { 453 448 * @type array $has Extracted media counts. { … … 477 472 478 473 $shortcode = array(); 479 $shortcode['attributes'] = $attrs; // Attributes 480 $shortcode['content'] = $matches[5][ $i ]; // Content 481 $shortcode['type'] = $shortcode_name; // Shortcode 482 $shortcode['original'] = $matches[0][ $i ]; // Entire shortcode 474 $shortcode['attributes'] = $attrs; // Attributes. 475 $shortcode['content'] = $matches[5][ $i ]; // Content. 476 $shortcode['type'] = $shortcode_name; // Shortcode. 477 $shortcode['original'] = $matches[0][ $i ]; // Entire shortcode. 483 478 484 479 $data['shortcodes'][] = $shortcode; … … 511 506 * @param string $plaintext Sanitized version of the content. 512 507 * @param array $extra_args Bespoke data for a particular extractor (optional). 513 *514 508 * @return array { 515 509 * @type array $has Extracted media counts. { … … 591 585 * @param string $plaintext Sanitized version of the content. 592 586 * @param array $extra_args Bespoke data for a particular extractor (optional). 593 *594 587 * @return array { 595 588 * @type array $has Extracted media counts. { … … 644 637 } 645 638 646 // <a href="*.mp3"> tags 639 // <a href="*.mp3"> tags. 647 640 foreach ( $audio_types as $extension ) { 648 641 $extension = '.' . $extension; … … 689 682 * @param string $plaintext Sanitized version of the content. 690 683 * @param array $extra_args Bespoke data for a particular extractor (optional). 691 *692 684 * @return array { 693 685 * @type array $has Extracted media counts. { … … 768 760 * @param string $plaintext Sanitized version of the content. 769 761 * @param array $extra_args Bespoke data for a particular extractor (optional). 770 *771 762 * @return array 772 763 */ … … 794 785 $image_size = array( $extra_args['width'], $extra_args['height'] ); 795 786 } else { 796 $image_size = $extra_args['width']; // e.g. "thumb", "medium".787 $image_size = $extra_args['width']; // E.g. "thumb", "medium". 797 788 } 798 789 … … 868 859 * @param string $plaintext Sanitized version of the content. 869 860 * @param array $extra_args Contains data that an implementation might need beyond the defaults. 870 *871 861 * @return array 872 862 */ … … 890 880 $image_size = array( $extra_args['width'], $extra_args['height'] ); 891 881 } else { 892 $image_size = $extra_args['width']; // e.g. "thumb", "medium".882 $image_size = $extra_args['width']; // E.g. "thumb", "medium". 893 883 } 894 884 } else { … … 919 909 * @since 2.3.0 920 910 * 921 * @param string $richtext 922 * 911 * @param string $richtext Content to sanitize. 923 912 * @return string 924 913 */
Note: See TracChangeset
for help on using the changeset viewer.