Changeset 13465
- Timestamp:
- 04/05/2024 07:53:57 AM (4 months ago)
- Location:
- sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/class-trademarks.php
r13462 r13465 1 1 <?php 2 2 namespace WordPressdotorg\Plugin_Directory; 3 3 4 4 5 use WP_Post; … … 120 121 'wordpess', 121 122 'wpress', 122 'wp-', 123 'wp-', 123 124 'wp-mail-smtp-', 124 125 'yandex-', … … 252 253 foreach ( $portmanteaus as $portmanteau ) { 253 254 if ( str_starts_with( $plugin_slug, $portmanteau ) ) { 254 $has_trademarked_slug[] = $portmanteau . '-'; // State that the portmanteau cannnot start the text. 255 // Check there isn't a longer matching trademark already flagged. 256 // For example, 'woo' should not flag if 'woocommerce' is already flagged. 257 if ( ! preg_grep( '!^' . preg_quote( $portmanteau, '!' ) . '!', $has_trademarked_slug ) ) { 258 $has_trademarked_slug[] = $portmanteau . '-'; // State that the portmanteau cannnot start the text. 259 } 255 260 } 256 261 } … … 270 275 271 276 // The users email domain. 272 if ( $user && $user ->exists() ) {277 if ( $user && $user->exists() ) { 273 278 $exceptions[] = explode( '@', $user->user_email, 2 )[1]; 274 279 } … … 280 285 * Get the exceptions allowed for a plugin. 281 286 * 282 * @param string $plugin_slug The plugin slug.287 * @param . 283 288 * @return array 284 289 */ 285 public static function get_plugin_exceptions( $plugin_slug ) { 286 return []; 290 public static function get_plugin_exceptions( $post ) { 291 // Assume all of the committers (and owner) are exceptions. 292 $committers = Tools::get_plugin_committers( $post ); 293 294 $committers = array_map( function( $user_login ) { return get_user_by( 'login', $user_login); }, $committers ); 295 $committers[] = get_user_by( 'id', $post->post_author ); 296 297 $exceptions = []; 298 foreach ( $committers as $user ) { 299 $exceptions = array_merge( $exceptions, self::get_user_exceptions( $user ) ); 300 } 301 302 return array_unique( $exceptions ); 287 303 } 288 304 } -
sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/readme/class-validator.php
r13462 r13465 408 408 409 409 if ( $cannot_start_with ) { 410 411 412 410 413 $messages[] = sprintf( 411 414 /* translators: 1: plugin slug, 2: trademarked term, 3: 'Plugin Name:', 4: plugin email address */
Note: See TracChangeset
for help on using the changeset viewer.