Changeset 3139434
- Timestamp:
- 08/22/2024 05:47:25 AM (19 months ago)
- Location:
- email-post-changes/trunk
- Files:
-
- 2 edited
-
class.email-post-changes.php (modified) (7 diffs)
-
email-post-changes.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
email-post-changes/trunk/class.email-post-changes.php
r3139338 r3139434 190 190 191 191 // HTML 192 $html_diff_head = '<h2>' . sprintf( __( '%s changed' ), $post_type_label ) . "</h2>\n";193 $html_diff_head .= '<p>' . sprintf( $head_sprintf,192 $html_diff_head = '<h2>' . sprintf( esc_html__( '%s changed' ), $post_type_label ) . "</h2>\n"; 193 $html_diff_head .= '<p>' . sprintf( esc_html( $head_sprintf ), 194 194 esc_html( $the_author ), 195 195 "<a href='$the_permalink'>" . esc_html( $the_title ) . '</a>', 196 "<a href='$the_edit_link'>" . __( '[edit]' ) . '</a>',197 $post_type_label,198 $the_date196 "<a href='$the_edit_link'>" . esc_html__( '[edit]' ) . '</a>', 197 esc_html( $post_type_label ), 198 esc_html( $the_date ) 199 199 ) . "</p>\n\n"; 200 200 … … 213 213 214 214 // Replace classes with inline style 215 $html_diff = str_replace( "class='diff'", 'style="width: 100%; border-collapse: collapse; border: none; white-space: pre-wrap; word-wrap: break-word; font-family: Consolas,Monaco,Courier,monospace;"', $html_diff );216 $html_diff = preg_replace( '#<col[^>]+/?>#i', '', $html_diff );217 $html_diff = str_replace( "class='diff-deletedline'", 'style="padding: 5px; width: 50%; background-color: #fdd;"', $html_diff );218 $html_diff = str_replace( "class='diff-addedline'", 'style="padding: 5px; width: 50%; background-color: #dfd;"', $html_diff );219 $html_diff = str_replace( "class='diff-context'", 'style="padding: 5px; width: 50%;"', $html_diff );220 $html_diff = str_replace( '<td>', '<td style="padding: 5px;">', $html_diff );221 215 $html_diff = str_replace( '<del>', '<del style="text-decoration: none; background-color: #f99;">', $html_diff ); 222 216 $html_diff = str_replace( '<ins>', '<ins style="text-decoration: none; background-color: #9f9;">', $html_diff ); … … 316 310 $return['enable'] = ( empty( $options['enable'] ) ) ? 0 : 1; 317 311 318 if ( empty( $options['users'] ) || ! is_array( $options) ) {312 if ( empty( $options['users'] ) || ! is_array( $options['users'] ) ) { 319 313 $return['users'] = $this->defaults['users']; 320 314 } else { … … 358 352 } 359 353 360 if ( empty( $options['post_types'] ) || ! is_array( $options) ) {354 if ( empty( $options['post_types'] ) || ! is_array( $options['post_types'] ) ) { 361 355 $return['post_types'] = $this->defaults['post_types']; 362 356 } else { … … 380 374 sprintf( 381 375 /* Translators: Comma-separated list of invalid email addresses. */ 382 _n( 'Invalid Email: %s', 'Invalid Emails: %s', is_countable( $options['invalid_emails'] ) ? count( $options['invalid_emails'] ) : 0),376 esc_html( _n( 'Invalid Email: %s', 'Invalid Emails: %s', is_countable( $options['invalid_emails'] ) ? count( $options['invalid_emails'] ) : 0 ) ), 383 377 '<kbd>' . implode( '</kbd>, <kbd>', array_map( 'esc_html', $options['invalid_emails'] ) ) 384 378 ) … … 515 509 return ''; 516 510 517 $r = "<table class='diff'>\n"; 518 $r .= "<col class='ltype' /><col class='content' /><col class='ltype' /><col class='content' />"; 511 $r = "<table style='width: 100%; border-collapse: collapse; border: none; white-space: pre-wrap; word-wrap: break-word; font-family: Consolas,Monaco,Courier,monospace;'>\n"; 519 512 520 513 if ( $args['title'] || $args['title_left'] || $args['title_right'] ) 521 $r .= "<thead> ";514 $r .= "<thead>\n"; 522 515 if ( $args['title'] ) 523 $r .= "<tr class='diff-title'><th colspan='4'> $args[title]</th></tr>\n";516 $r .= "<tr class='diff-title'><th colspan='4'>" . esc_html( $args['title'] ) . "</th></tr>\n"; 524 517 if ( $args['title_left'] || $args['title_right'] ) { 525 518 $r .= "<tr class='diff-sub-title'>\n"; 526 $r .= "\t<td></td><th> $args[title_left]</th>\n";527 $r .= "\t<td></td><th> $args[title_right]</th>\n";519 $r .= "\t<td></td><th>" . esc_html( $args['title_left'] ) . "</th>\n"; 520 $r .= "\t<td></td><th>" . esc_html( $args['title_right'] ) . "</th>\n"; 528 521 $r .= "</tr>\n"; 529 522 } … … 542 535 var $_leading_context_lines = 2; 543 536 var $_trailing_context_lines = 2; 537 538 /** 539 * @ignore 540 * 541 * @param string $line HTML-escape the value. 542 * @return string 543 */ 544 public function addedLine( $line ) { 545 return "<td style='padding: 5px; width: 1em; text-align: end;' aria-label='" . __( 'Added:' ) . "'><span aria-hidden='true'>+</span></td>" 546 . "<td style='padding: 5px; width: 50%; width: calc( 50% - 1em - 10px ); background-color: #dfd;'>{$line}</td>"; 547 } 548 549 /** 550 * @ignore 551 * 552 * @param string $line HTML-escape the value. 553 * @return string 554 */ 555 public function deletedLine( $line ) { 556 return "<td style='padding: 5px; width: 1em; text-align: end;' aria-label='" . __( 'Deleted:' ) . "'><span aria-hidden='true'>-</span></td>" 557 . "<td style='padding: 5px; width: 50%; width: calc( 50% - 1em - 10px ); background-color: #fdd;'>{$line}</td>"; 558 } 559 560 /** 561 * @ignore 562 * 563 * @param string $line HTML-escape the value. 564 * @return string 565 */ 566 public function contextLine( $line ) { 567 return "<td style='padding: 5px; width: 1em;' aria-label='" . __( 'Unchanged:' ) . "'><span aria-hidden='true'> </span></td>" 568 . "<td style='padding: 5px; width: 50%; width: calc( 50% - 1em - 10px );'>{$line}</td>"; 569 } 570 571 /** 572 * @ignore 573 * 574 * @return string 575 */ 576 public function emptyLine() { 577 return '<td colspan="2" style="padding: 5px;"> </td>'; 578 } 544 579 } -
email-post-changes/trunk/email-post-changes.php
r3139338 r3139434 5 5 Description: Whenever a change to a post or page is made, those changes are emailed to the users and email addresses you specify. 6 6 Plugin URI: http://wordpress.org/extend/plugins/email-post-changes/ 7 Version: 1. 7.27 Version: 1.8 8 8 Author: Michael D Adams 9 9 Author URI: http://blogwaffe.com/
Note: See TracChangeset
for help on using the changeset viewer.