Making WordPress.org

Changeset 5279


Ignore:
Timestamp:
04/07/2017 11:33:44 AM (8 years ago)
Author:
ocean90
Message:

Theme Directory: Do not allow themes to have "WordPress" and "theme" in the theme name.

Props grapplerulrich.
Fixes #2306.

File:
1 edited

Legend:

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

    r4891 r5279  
    142142        $this->theme_slug = sanitize_title_with_dashes( $this->theme_name );
    143143
    144         $this->author     = wp_get_current_user();
     144        // 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' ) ) {
     146            return __( 'You cannot use WordPress or theme in your theme name.', 'wporg-themes' );
     147        }
     148
     149        // Populate author.
     150        $this->author = wp_get_current_user();
    145151
    146152        // Make sure it doesn't use a slug deemed not to be used by the public.
     
    153159        }
    154160
    155         // populate the theme post and author
     161        // Populate the theme post.
    156162        $this->theme_post = $this->get_theme_post();
    157163
     
    568574            $this->trac_ticket->description .= "\nTheme Check Results:\n" . $theme_check_results;
    569575        }
    570        
     576
    571577    }
    572578
Note: See TracChangeset for help on using the changeset viewer.