Changeset 4482
- Timestamp:
- 12/04/2016 09:53:30 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/class-wporg-themes-upload.php
r2695 r4482 282 282 '<a href="mailto:themes@wordpress.org">themes@wordpress.org</a>' 283 283 ); 284 } 285 286 /* 287 * Add a comment to the trac ticket with the results of the theme check, if any exists. 288 */ 289 if ( !empty( $GLOBALS['themechecks'] ) ) { 290 $tc_errors = $tc_results = array(); 291 foreach ( $GLOBALS['themechecks'] as $check ) { 292 if ( $check instanceof \themecheck ) { 293 $error = (array) $check->getError(); 294 if ( $error ) { 295 $tc_errors = array_unique( array_merge( $tc_errors, $error ) ); 296 } 297 } 298 } 299 if ( $tc_errors ) { 300 foreach ( $tc_errors as $e ) { 301 $trac_left = array( '<strong>', '</strong>' ); 302 $trac_right= array( "'''", "'''" ); 303 $html_link = '/<a\s?href\s?=\s?[\'|"]([^"|\']*)[\'|"]>([^<]*)<\/a>/i'; 304 $html_new = '[$1 $2]'; 305 $e = preg_replace( $html_link, $html_new, $e ); 306 $e = str_replace( $trac_left, $trac_right, $e ); 307 $e = preg_replace( '/<pre.*?>/', "\r\n{{{\r\n", $e ); 308 $e = str_replace( '</pre>', "\r\n}}}\r\n", $e ); 309 310 $e = preg_replace( '!<span class="[^"]+">([^<]+)</span>!', '$1', $e ); 311 312 if ( 'INFO' !== substr( $e, 0, 4 ) ) { 313 $tc_results[] = '* ' . $e; 314 } 315 } 316 } 317 318 if ( $tc_results ) { 319 $tc_results = implode( "\n", $tc_results ); 320 321 $this->trac->ticket_update( 322 $ticket_id, 323 "Theme Check Results:\n" . $tc_results 324 ); 325 } 284 326 } 285 327
Note: See TracChangeset
for help on using the changeset viewer.