Making WordPress.org

Changeset 5726


Ignore:
Timestamp:
07/28/2017 08:29:48 PM (8 years ago)
Author:
Otto42
Message:

Themes Directory: Only find whole word matches for 'theme' in names and prevent those. Allow partials.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-upload.php

    r5375 r5726  
    143143
    144144        // Do not allow themes with WordPress and Theme in the theme name.
    145         if ( false !== strpos( $this->theme_slug, 'wordpress' ) || false !== strpos( $this->theme_slug, 'theme' ) ) {
     145        if ( false !== strpos( $this->theme_slug, 'wordpress' ) || preg_match( '/\btheme\b/i', $this->theme_slug ) ) {
    146146            /* translators: 1: 'WordPress', 2: 'theme' */
    147147            return sprintf( __( 'You cannot use %1$s or %2$s in your theme name.', 'wporg-themes' ),
Note: See TracChangeset for help on using the changeset viewer.