Skip to content

Commit

Permalink
Merge pull request #3050 from andrewlimaza/fix-email-from
Browse files Browse the repository at this point in the history
Fixed slashes in From Name setting.
  • Loading branch information
dparker1005 authored Jul 11, 2024
2 parents 6c3e579 + 849feb5 commit 4de81ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion adminpages/emailsettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<label for="from_name"><?php esc_html_e('From Name', 'paid-memberships-pro' );?>:</label>
</th>
<td>
<input type="text" name="from_name" value="<?php echo esc_attr($from_name);?>" class="regular-text" />
<input type="text" name="from_name" value="<?php echo esc_attr( wp_unslash($from_name) );?>" class="regular-text" />
</td>
</tr>
<tr>
Expand Down
12 changes: 6 additions & 6 deletions includes/email.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ function pmpro_wp_mail_from_name( $from_name ) {
$default_from_name = 'WordPress';

//make sure it's the default from name
if($from_name == $default_from_name)
{
$pmpro_from_name = get_option("pmpro_from_name");
if ($pmpro_from_name)
$from_name = stripslashes($pmpro_from_name);
if( $from_name == $default_from_name ) {
$pmpro_from_name = get_option( 'pmpro_from_name' );
if ($pmpro_from_name) {
$from_name = $pmpro_from_name;
}
}

return $from_name;
return wp_unslash( $from_name );
}

/**
Expand Down

0 comments on commit 4de81ef

Please sign in to comment.