Making WordPress.org


Ignore:
Timestamp:
12/15/2021 02:47:05 AM (5 years ago)
Author:
dd32
Message:

SVN Watcher: Some performance improvements for the admin view & reports.

This reduces the queries by removing oEmbed processing of commit messages, caching users in bulk, avoiding PHP Notices, documenting some things, skipping the UI if revisions/props aren't imported for a SVN.

See #5978.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-trac-watcher/trac.php

    r11362 r11371  
    88function format_trac_markup( $message ) {
    99        $message = esc_html( $message );
     10
     11        // Convert some Trac markdown to HTML.
    1012        $message = preg_replace( '!`(.*?)`!i', '<code>$1</code>', $message );
    1113        $message = preg_replace( '!{{{(.*?)}}}!sm', '<code>$1</code>', $message );
    12 
    1314        $message = preg_replace( '!\[([^] ]+) ([^]]+)\]!i', '<a href="$1">$2</a>', $message );
    1415
    15         // Escape shortcodes, but that takes out changesets..
    16         // $message = str_replace( [ '[', ']'], [ '[[', ']]' ], $message );
     16        // Mark up the text, using functions we want, rather than `the_content` as it has many filters that don't strictly apply.
     17        $message = wptexturize( $message );
     18        $message = wpautop( $message );
     19        $message = make_clickable( $message );
    1720
    18         // Might need to disable this, or escape more things prior to it.
    19         $message = apply_filters( 'the_content', $message );
    20         $message = make_clickable( $message );
     21        // Link tickets and changesets.
     22        if ( function_exists( 'markup_wporg_links' ) ) {
     23                $message = markup_wporg_links( $message );
     24        }
     25
     26        // Ensure nothing funny is in the output.
     27        $message = wp_kses_post( $message );
    2128
    2229        return $message;
Note: See TracChangeset for help on using the changeset viewer.