Making WordPress.org

Changeset 12469


Ignore:
Timestamp:
03/14/2023 07:30:35 AM (3 years ago)
Author:
dd32
Message:

HelpScout: Whitespace, explicit regex on the slug (Don't match HTML entities), fix the SQL matching to limit to the correct post_type.

Location:
sites/trunk/api.wordpress.org/public_html/dotorg/helpscout
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/api.wordpress.org/public_html/dotorg/helpscout/common.php

    r12468 r12469  
    148148
    149149    $regexes = [
    150         '!/([^/]+\.)?wordpress.org/(?<type>plugins|themes)/(?P<slug>[^/]+)/?!im',
     150        '!/([^/]+\.)?wordpress.org/(?<type>plugins|themes)/(?P<slug>[a-z0-9-]+)/?!im',
    151151        '!(?P<type>Plugin|Theme):\s*(?P<slug>[a-z0-9-]+)$!im',
    152         '!(?P<type>plugins|themes)\.(trac|svn)\.wordpress\.org/(browser/)?(?P<slug>[^/]+)!im',
     152        '!(?P<type>plugins|themes)\.(trac|svn)\.wordpress\.org/(browser/)?(?P<slug>[a-z0-9-]+)!im',
    153153    ];
    154154
  • sites/trunk/api.wordpress.org/public_html/dotorg/helpscout/plugins-themes.php

    r12467 r12469  
    5959
    6060        display_items( $post_ids );
     61
     62        echo '<br/>';
    6163    }
    6264
     
    7476
    7577            display_items( $items );
     78
     79            echo '<br/>';
    7680        }
    7781
     
    116120            "SELECT ID
    117121            FROM $wpdb->posts
    118             WHERE post_type IN( 'plugin', 'repopackage' ) AND {$where}
     122            WHERE post_type IN( 'plugin', 'repopackage' ) AND ( {$where} )
    119123            ORDER BY FIELD( post_status, 'new', 'pending', 'publish', 'disabled', 'delisted', 'closed', 'approved', 'suspended', 'rejected', 'draft' ), post_title",
    120124        );
Note: See TracChangeset for help on using the changeset viewer.