Making WordPress.org

Changeset 10430


Ignore:
Timestamp:
11/05/2020 08:15:30 PM (4 years ago)
Author:
Otto42
Message:

Plugin Directory: Readme Parser: Allow data:text/plain streams to pass through parse_readme() also, to allow them to become plain contents before parsing them. Fixes #5502, corrects [10429].

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-parser.php

    r10429 r10430  
    154154     *
    155155     * @param string $string A Filepath, URL, or contents of a readme to parse.
     156     *
     157     * Note: data:text/plain streams are URLs and need to pass through
     158     * the parse_readme() function, not the parse_readme_contents() function, so
     159     * that they can be turned from a URL into plain text via the stream.
    156160     */
    157161    public function __construct( $string ) {
    158         if ( file_exists( $string ) || preg_match( '!^https?://!i', $string ) ) {
     162        if ( file_exists( $string )
     163            || preg_match( '!^https?://!i', $string )
     164            || preg_match( '!^data:text/plain!i', $string) )
     165        {
    159166            $this->parse_readme( $string );
    160167        } elseif ( $string ) {
Note: See TracChangeset for help on using the changeset viewer.