Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/jetpack/modules/comments
File: comments.php
printf(
[500] Fix | Delete
'</%1$s>',
[501] Fix | Delete
esc_html( $comment_reply_title_tag )
[502] Fix | Delete
);
[503] Fix | Delete
endif;
[504] Fix | Delete
?>
[505] Fix | Delete
<form id="commentform" class="comment-form">
[506] Fix | Delete
<iframe
[507] Fix | Delete
title="<?php esc_attr_e( 'Comment Form', 'jetpack' ); ?>"
[508] Fix | Delete
src="<?php echo esc_url( $url ); ?>"
[509] Fix | Delete
<?php if ( $is_amp ) : ?>
[510] Fix | Delete
resizable
[511] Fix | Delete
layout="fixed-height"
[512] Fix | Delete
height="<?php echo esc_attr( $height ); ?>"
[513] Fix | Delete
<?php else : ?>
[514] Fix | Delete
name="jetpack_remote_comment"
[515] Fix | Delete
style="width:100%; height: <?php echo esc_attr( $height ); ?>px; border:0;"
[516] Fix | Delete
<?php endif; ?>
[517] Fix | Delete
class="jetpack_remote_comment"
[518] Fix | Delete
id="jetpack_remote_comment"
[519] Fix | Delete
sandbox="allow-same-origin allow-top-navigation allow-scripts allow-forms allow-popups"
[520] Fix | Delete
>
[521] Fix | Delete
<?php if ( $is_amp ) : ?>
[522] Fix | Delete
<button overflow><?php esc_html_e( 'Show more', 'jetpack' ); ?></button>
[523] Fix | Delete
<?php endif; ?>
[524] Fix | Delete
</iframe>
[525] Fix | Delete
<?php if ( ! $is_amp ) : ?>
[526] Fix | Delete
<!--[if !IE]><!-->
[527] Fix | Delete
<script>
[528] Fix | Delete
document.addEventListener('DOMContentLoaded', function () {
[529] Fix | Delete
var commentForms = document.getElementsByClassName('jetpack_remote_comment');
[530] Fix | Delete
for (var i = 0; i < commentForms.length; i++) {
[531] Fix | Delete
commentForms[i].allowTransparency = <?php echo esc_html( $transparent ); ?>;
[532] Fix | Delete
commentForms[i].scrolling = 'no';
[533] Fix | Delete
}
[534] Fix | Delete
});
[535] Fix | Delete
</script>
[536] Fix | Delete
<!--<![endif]-->
[537] Fix | Delete
<?php endif; ?>
[538] Fix | Delete
</form>
[539] Fix | Delete
</div>
[540] Fix | Delete
[541] Fix | Delete
<?php // Below is required for comment reply JS to work. ?>
[542] Fix | Delete
[543] Fix | Delete
<input type="hidden" name="comment_parent" id="comment_parent" value="" />
[544] Fix | Delete
[545] Fix | Delete
<?php
[546] Fix | Delete
}
[547] Fix | Delete
[548] Fix | Delete
/**
[549] Fix | Delete
* Add some JS to wp_footer to watch for hierarchical reply parent change
[550] Fix | Delete
*
[551] Fix | Delete
* If AMP is enabled, we don't make any changes.
[552] Fix | Delete
*
[553] Fix | Delete
* @since 1.4
[554] Fix | Delete
*/
[555] Fix | Delete
public function watch_comment_parent() {
[556] Fix | Delete
if ( class_exists( Jetpack_AMP_Support::class ) && Jetpack_AMP_Support::is_amp_request() ) {
[557] Fix | Delete
// @todo Implement AMP support.
[558] Fix | Delete
return;
[559] Fix | Delete
}
[560] Fix | Delete
?>
[561] Fix | Delete
<script type="text/javascript">
[562] Fix | Delete
(function () {
[563] Fix | Delete
const iframe = document.getElementById( 'jetpack_remote_comment' );
[564] Fix | Delete
<?php if ( get_option( 'thread_comments' ) && get_option( 'thread_comments_depth' ) ) : ?>
[565] Fix | Delete
const watchReply = function() {
[566] Fix | Delete
// Check addComment._Jetpack_moveForm to make sure we don't monkey-patch twice.
[567] Fix | Delete
if ( 'undefined' !== typeof addComment && ! addComment._Jetpack_moveForm ) {
[568] Fix | Delete
// Cache the Core function.
[569] Fix | Delete
addComment._Jetpack_moveForm = addComment.moveForm;
[570] Fix | Delete
const commentParent = document.getElementById( 'comment_parent' );
[571] Fix | Delete
const cancel = document.getElementById( 'cancel-comment-reply-link' );
[572] Fix | Delete
[573] Fix | Delete
function tellFrameNewParent ( commentParentValue ) {
[574] Fix | Delete
const url = new URL( iframe.src );
[575] Fix | Delete
if ( commentParentValue ) {
[576] Fix | Delete
url.searchParams.set( 'replytocom', commentParentValue )
[577] Fix | Delete
} else {
[578] Fix | Delete
url.searchParams.delete( 'replytocom' );
[579] Fix | Delete
}
[580] Fix | Delete
if( iframe.src !== url.href ) {
[581] Fix | Delete
iframe.src = url.href;
[582] Fix | Delete
}
[583] Fix | Delete
};
[584] Fix | Delete
[585] Fix | Delete
cancel.addEventListener( 'click', function () {
[586] Fix | Delete
tellFrameNewParent( false );
[587] Fix | Delete
} );
[588] Fix | Delete
[589] Fix | Delete
addComment.moveForm = function ( _, parentId ) {
[590] Fix | Delete
tellFrameNewParent( parentId );
[591] Fix | Delete
return addComment._Jetpack_moveForm.apply( null, arguments );
[592] Fix | Delete
};
[593] Fix | Delete
}
[594] Fix | Delete
}
[595] Fix | Delete
document.addEventListener( 'DOMContentLoaded', watchReply );
[596] Fix | Delete
// In WP 6.4+, the script is loaded asynchronously, so we need to wait for it to load before we monkey-patch the functions it introduces.
[597] Fix | Delete
document.querySelector('#comment-reply-js')?.addEventListener( 'load', watchReply );
[598] Fix | Delete
[599] Fix | Delete
<?php endif; ?>
[600] Fix | Delete
[601] Fix | Delete
const commentIframes = document.getElementsByClassName('jetpack_remote_comment');
[602] Fix | Delete
[603] Fix | Delete
window.addEventListener('message', function(event) {
[604] Fix | Delete
if (event.origin !== 'https://jetpack.wordpress.com') {
[605] Fix | Delete
return;
[606] Fix | Delete
}
[607] Fix | Delete
[608] Fix | Delete
if (!event?.data?.iframeUniqueId && !event?.data?.height) {
[609] Fix | Delete
return;
[610] Fix | Delete
}
[611] Fix | Delete
[612] Fix | Delete
const eventDataUniqueId = event.data.iframeUniqueId;
[613] Fix | Delete
[614] Fix | Delete
// Change height for the matching comment iframe
[615] Fix | Delete
for (let i = 0; i < commentIframes.length; i++) {
[616] Fix | Delete
const iframe = commentIframes[i];
[617] Fix | Delete
const url = new URL(iframe.src);
[618] Fix | Delete
const iframeUniqueIdParam = url.searchParams.get('iframe_unique_id');
[619] Fix | Delete
if (iframeUniqueIdParam == event.data.iframeUniqueId) {
[620] Fix | Delete
iframe.style.height = event.data.height + 'px';
[621] Fix | Delete
return;
[622] Fix | Delete
}
[623] Fix | Delete
}
[624] Fix | Delete
});
[625] Fix | Delete
})();
[626] Fix | Delete
</script>
[627] Fix | Delete
<?php
[628] Fix | Delete
}
[629] Fix | Delete
[630] Fix | Delete
/**
[631] Fix | Delete
* Verify the hash included in remote comments.
[632] Fix | Delete
*
[633] Fix | Delete
* If the Jetpack token is missing we return nothing,
[634] Fix | Delete
* and if the token is unknown or invalid, or comments not allowed, an error is returned.
[635] Fix | Delete
*
[636] Fix | Delete
* @since 1.4
[637] Fix | Delete
*/
[638] Fix | Delete
public function pre_comment_on_post() {
[639] Fix | Delete
$post_array = stripslashes_deep( $_POST );
[640] Fix | Delete
[641] Fix | Delete
// Bail if missing the Jetpack token.
[642] Fix | Delete
if ( ! isset( $post_array['sig'] ) || ! isset( $post_array['token_key'] ) || ! is_string( $post_array['sig'] ) ) {
[643] Fix | Delete
unset( $_POST['hc_post_as'] );
[644] Fix | Delete
return;
[645] Fix | Delete
}
[646] Fix | Delete
[647] Fix | Delete
if ( empty( $post_array['jetpack_comments_nonce'] ) || ! wp_verify_nonce( $post_array['jetpack_comments_nonce'], "jetpack_comments_nonce-{$post_array['comment_post_ID']}" ) ) {
[648] Fix | Delete
if ( ! isset( $_GET['only_once'] ) ) {
[649] Fix | Delete
self::retry_submit_comment_form_locally();
[650] Fix | Delete
}
[651] Fix | Delete
wp_die( esc_html__( 'Nonce verification failed.', 'jetpack' ), 400 );
[652] Fix | Delete
}
[653] Fix | Delete
[654] Fix | Delete
if ( is_string( $post_array['hc_avatar'] ) && str_contains( $post_array['hc_avatar'], '.gravatar.com' ) ) {
[655] Fix | Delete
$post_array['hc_avatar'] = htmlentities( $post_array['hc_avatar'], ENT_COMPAT );
[656] Fix | Delete
}
[657] Fix | Delete
[658] Fix | Delete
$blog_token = ( new Tokens() )->get_access_token( false, $post_array['token_key'] );
[659] Fix | Delete
if ( ! $blog_token || is_wp_error( $blog_token ) ) {
[660] Fix | Delete
wp_die( esc_html__( 'Unknown security token.', 'jetpack' ), 400 );
[661] Fix | Delete
}
[662] Fix | Delete
$check = self::sign_remote_comment_parameters( $post_array, $blog_token->secret );
[663] Fix | Delete
if ( is_wp_error( $check ) ) {
[664] Fix | Delete
wp_die( esc_html( $check ) );
[665] Fix | Delete
}
[666] Fix | Delete
[667] Fix | Delete
// Bail if token is expired or not valid.
[668] Fix | Delete
if ( ! hash_equals( $check, $post_array['sig'] ) ) {
[669] Fix | Delete
wp_die( esc_html__( 'Invalid security token.', 'jetpack' ), 400 );
[670] Fix | Delete
}
[671] Fix | Delete
[672] Fix | Delete
/** This filter is documented in modules/comments/comments.php */
[673] Fix | Delete
if ( ! apply_filters( 'jetpack_comment_form_enabled_for_' . get_post_type( $post_array['comment_post_ID'] ), true ) ) {
[674] Fix | Delete
// In case the comment POST is legit, but the comments are
[675] Fix | Delete
// now disabled, we don't allow the comment.
[676] Fix | Delete
[677] Fix | Delete
wp_die( esc_html__( 'Comments are not allowed.', 'jetpack' ), 403 );
[678] Fix | Delete
}
[679] Fix | Delete
}
[680] Fix | Delete
[681] Fix | Delete
/**
[682] Fix | Delete
* Handle Jetpack Comments POST requests: process the comment form, then client-side POST the results to the self-hosted blog
[683] Fix | Delete
*
[684] Fix | Delete
* This function exists because when we submit the form via the jetpack.wordpress.com iframe
[685] Fix | Delete
* in Chrome the request comes in to Jetpack but for some reason the request doesn't have access to cookies yet.
[686] Fix | Delete
* By submitting the form again locally with the same data the process works as expected.
[687] Fix | Delete
*
[688] Fix | Delete
* @return never
[689] Fix | Delete
*/
[690] Fix | Delete
public function retry_submit_comment_form_locally() {
[691] Fix | Delete
// We are not doing any validation here since all the validation will be done again by pre_comment_on_post().
[692] Fix | Delete
// phpcs:ignore WordPress.Security.NonceVerification.Missing
[693] Fix | Delete
$comment_data = stripslashes_deep( $_POST );
[694] Fix | Delete
?>
[695] Fix | Delete
<!DOCTYPE html>
[696] Fix | Delete
<html>
[697] Fix | Delete
<head>
[698] Fix | Delete
<link rel="preload" as="image" href="https://jetpack.wordpress.com/wp-admin/images/spinner.gif"> <!-- Preload the spinner image -->
[699] Fix | Delete
<meta charset="utf-8">
[700] Fix | Delete
<title><?php echo esc_html__( 'Submitting Comment', 'jetpack' ); ?></title>
[701] Fix | Delete
<style type="text/css">
[702] Fix | Delete
body {
[703] Fix | Delete
display: table;
[704] Fix | Delete
width: 100%;
[705] Fix | Delete
height: 60%;
[706] Fix | Delete
position: absolute;
[707] Fix | Delete
top: 0;
[708] Fix | Delete
left: 0;
[709] Fix | Delete
overflow: hidden;
[710] Fix | Delete
color: #333;
[711] Fix | Delete
}
[712] Fix | Delete
</style>
[713] Fix | Delete
</head>
[714] Fix | Delete
<body>
[715] Fix | Delete
<img src="https://jetpack.wordpress.com/wp-admin/images/spinner.gif" >
[716] Fix | Delete
<form id="jetpack-remote-comment-post-form" action="<?php echo esc_url( get_site_url() ); ?>/wp-comments-post.php?for=jetpack&only_once=true" method="POST">
[717] Fix | Delete
<?php foreach ( $comment_data as $key => $val ) : ?>
[718] Fix | Delete
<input type="hidden" name="<?php echo esc_attr( $key ); ?>" value="<?php echo esc_attr( $val ); ?>" />
[719] Fix | Delete
<?php endforeach; ?>
[720] Fix | Delete
</form>
[721] Fix | Delete
[722] Fix | Delete
<script type="text/javascript">
[723] Fix | Delete
document.getElementById("jetpack-remote-comment-post-form").submit();
[724] Fix | Delete
</script>
[725] Fix | Delete
</body>
[726] Fix | Delete
</html>
[727] Fix | Delete
<?php
[728] Fix | Delete
exit( 0 );
[729] Fix | Delete
}
[730] Fix | Delete
[731] Fix | Delete
/** Capabilities **********************************************************/
[732] Fix | Delete
[733] Fix | Delete
/**
[734] Fix | Delete
* Add some additional comment meta after comment is saved about what
[735] Fix | Delete
* service the comment is from, the avatar, user_id, etc...
[736] Fix | Delete
*
[737] Fix | Delete
* @since 1.4
[738] Fix | Delete
*
[739] Fix | Delete
* @param int $comment_id The comment ID.
[740] Fix | Delete
*/
[741] Fix | Delete
public function add_comment_meta( $comment_id ) {
[742] Fix | Delete
$comment_meta = array();
[743] Fix | Delete
[744] Fix | Delete
// phpcs:disable WordPress.Security.NonceVerification.Missing
[745] Fix | Delete
switch ( $this->is_highlander_comment_post() ) {
[746] Fix | Delete
case 'facebook':
[747] Fix | Delete
$comment_meta['hc_post_as'] = 'facebook';
[748] Fix | Delete
$comment_meta['hc_avatar'] = isset( $_POST['hc_avatar'] ) ? filter_var( wp_unslash( $_POST['hc_avatar'] ) ) : null;
[749] Fix | Delete
$comment_meta['hc_foreign_user_id'] = isset( $_POST['hc_userid'] ) ? filter_var( wp_unslash( $_POST['hc_userid'] ) ) : null;
[750] Fix | Delete
break;
[751] Fix | Delete
[752] Fix | Delete
// phpcs:ignore WordPress.WP.CapitalPDangit
[753] Fix | Delete
case 'wordpress':
[754] Fix | Delete
// phpcs:ignore WordPress.WP.CapitalPDangit
[755] Fix | Delete
$comment_meta['hc_post_as'] = 'wordpress';
[756] Fix | Delete
$comment_meta['hc_avatar'] = isset( $_POST['hc_avatar'] ) ? filter_var( wp_unslash( $_POST['hc_avatar'] ) ) : null;
[757] Fix | Delete
$comment_meta['hc_foreign_user_id'] = isset( $_POST['hc_userid'] ) ? filter_var( wp_unslash( $_POST['hc_userid'] ) ) : null;
[758] Fix | Delete
$comment_meta['hc_wpcom_id_sig'] = isset( $_POST['hc_wpcom_id_sig'] ) ? filter_var( wp_unslash( $_POST['hc_wpcom_id_sig'] ) ) : null; // since 1.9.
[759] Fix | Delete
break;
[760] Fix | Delete
[761] Fix | Delete
case 'jetpack':
[762] Fix | Delete
$comment_meta['hc_post_as'] = 'jetpack';
[763] Fix | Delete
$comment_meta['hc_avatar'] = isset( $_POST['hc_avatar'] ) ? filter_var( wp_unslash( $_POST['hc_avatar'] ) ) : null;
[764] Fix | Delete
$comment_meta['hc_foreign_user_id'] = isset( $_POST['hc_userid'] ) ? filter_var( wp_unslash( $_POST['hc_userid'] ) ) : null;
[765] Fix | Delete
break;
[766] Fix | Delete
[767] Fix | Delete
}
[768] Fix | Delete
// phpcs:enable WordPress.Security.NonceVerification.Missing
[769] Fix | Delete
[770] Fix | Delete
// Bail if no extra comment meta.
[771] Fix | Delete
if ( empty( $comment_meta ) ) {
[772] Fix | Delete
return;
[773] Fix | Delete
}
[774] Fix | Delete
[775] Fix | Delete
// Loop through extra meta and add values.
[776] Fix | Delete
foreach ( $comment_meta as $key => $value ) {
[777] Fix | Delete
add_comment_meta( $comment_id, $key, $value, true );
[778] Fix | Delete
}
[779] Fix | Delete
}
[780] Fix | Delete
[781] Fix | Delete
/**
[782] Fix | Delete
* Should show the subscription modal
[783] Fix | Delete
*
[784] Fix | Delete
* @return boolean
[785] Fix | Delete
*/
[786] Fix | Delete
public function should_show_subscription_modal() {
[787] Fix | Delete
[788] Fix | Delete
// Not allow it to run on self-hosted or simple sites
[789] Fix | Delete
if ( ! ( new Host() )->is_wpcom_platform() || ( new Host() )->is_wpcom_simple() ) {
[790] Fix | Delete
return false;
[791] Fix | Delete
}
[792] Fix | Delete
[793] Fix | Delete
// phpcs:disable WordPress.Security.NonceVerification.Missing
[794] Fix | Delete
$is_current_user_subscribed = (bool) isset( $_POST['is_current_user_subscribed'] ) ? filter_var( wp_unslash( $_POST['is_current_user_subscribed'] ) ) : null;
[795] Fix | Delete
[796] Fix | Delete
// Atomic sites with jetpack_verbum_subscription_modal option enabled
[797] Fix | Delete
$modal_enabled = ( new Host() )->is_woa_site() && get_option( 'jetpack_verbum_subscription_modal', true );
[798] Fix | Delete
[799] Fix | Delete
return $modal_enabled && ! $is_current_user_subscribed;
[800] Fix | Delete
}
[801] Fix | Delete
[802] Fix | Delete
/**
[803] Fix | Delete
* Get the data to send as an event to the parent window on subscription modal
[804] Fix | Delete
*
[805] Fix | Delete
* @param string $url url to redirect to.
[806] Fix | Delete
*
[807] Fix | Delete
* @return array
[808] Fix | Delete
*/
[809] Fix | Delete
public function get_subscription_modal_data_to_parent( $url ) {
[810] Fix | Delete
// phpcs:ignore WordPress.Security.NonceVerification.Missing
[811] Fix | Delete
$current_user_email = isset( $_POST['email'] ) ? filter_var( wp_unslash( $_POST['email'] ) ) : null;
[812] Fix | Delete
// phpcs:ignore WordPress.Security.NonceVerification.Missing
[813] Fix | Delete
$post_id = isset( $_POST['comment_post_ID'] ) ? filter_var( wp_unslash( $_POST['comment_post_ID'] ) ) : null;
[814] Fix | Delete
return array(
[815] Fix | Delete
'url' => $url,
[816] Fix | Delete
'email' => $current_user_email,
[817] Fix | Delete
'blog_id' => esc_attr( \Jetpack_Options::get_option( 'id' ) ),
[818] Fix | Delete
'post_id' => esc_attr( $post_id ),
[819] Fix | Delete
'lang' => esc_attr( get_locale() ),
[820] Fix | Delete
'is_logged_in' => isset( $_POST['hc_userid'] ),
[821] Fix | Delete
);
[822] Fix | Delete
}
[823] Fix | Delete
[824] Fix | Delete
/**
[825] Fix | Delete
* Track the hidden event for the subscription modal
[826] Fix | Delete
*/
[827] Fix | Delete
public function subscription_modal_status_track_event() {
[828] Fix | Delete
$tracking_event = 'hidden_disabled';
[829] Fix | Delete
// Not allow it to run on self-hosted or simple sites
[830] Fix | Delete
if ( ! ( new Host() )->is_wpcom_platform() || ( new Host() )->is_wpcom_simple() ) {
[831] Fix | Delete
$tracking_event = 'hidden_self_hosted';
[832] Fix | Delete
}
[833] Fix | Delete
[834] Fix | Delete
// phpcs:disable WordPress.Security.NonceVerification.Missing
[835] Fix | Delete
$is_current_user_subscribed = (bool) isset( $_POST['is_current_user_subscribed'] ) ? filter_var( wp_unslash( $_POST['is_current_user_subscribed'] ) ) : null;
[836] Fix | Delete
[837] Fix | Delete
if ( $is_current_user_subscribed ) {
[838] Fix | Delete
$tracking_event = 'hidden_already_subscribed';
[839] Fix | Delete
}
[840] Fix | Delete
[841] Fix | Delete
$jetpack = Jetpack::init();
[842] Fix | Delete
// $jetpack->stat automatically prepends the stat group with 'jetpack-'
[843] Fix | Delete
$jetpack->stat( 'subscribe-modal-comm', $tracking_event );
[844] Fix | Delete
$jetpack->do_stats( 'server_side' );
[845] Fix | Delete
}
[846] Fix | Delete
[847] Fix | Delete
/**
[848] Fix | Delete
* Catch the duplicated comment error and show a custom error page
[849] Fix | Delete
*
[850] Fix | Delete
* @return never
[851] Fix | Delete
*/
[852] Fix | Delete
public function capture_comment_duplicate_trigger() {
[853] Fix | Delete
if ( ! isset( $_GET['for'] ) || 'jetpack' !== $_GET['for'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
[854] Fix | Delete
exit( 0 );
[855] Fix | Delete
}
[856] Fix | Delete
[857] Fix | Delete
?>
[858] Fix | Delete
<!DOCTYPE html>
[859] Fix | Delete
<html <?php language_attributes(); ?>>
[860] Fix | Delete
<!--<![endif]-->
[861] Fix | Delete
<head>
[862] Fix | Delete
<meta charset="<?php bloginfo( 'charset' ); ?>" />
[863] Fix | Delete
<title>
[864] Fix | Delete
<?php
[865] Fix | Delete
wp_kses_post(
[866] Fix | Delete
printf(
[867] Fix | Delete
/* translators: %s is replaced by an ellipsis */
[868] Fix | Delete
__( 'Submitting Comment%s', 'jetpack' ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
[869] Fix | Delete
'&hellip;'
[870] Fix | Delete
)
[871] Fix | Delete
);
[872] Fix | Delete
?>
[873] Fix | Delete
</title>
[874] Fix | Delete
<style type="text/css">
[875] Fix | Delete
body {
[876] Fix | Delete
display: table;
[877] Fix | Delete
width: 100%;
[878] Fix | Delete
height: 60%;
[879] Fix | Delete
position: absolute;
[880] Fix | Delete
top: 0;
[881] Fix | Delete
left: 0;
[882] Fix | Delete
overflow: hidden;
[883] Fix | Delete
color: #333;
[884] Fix | Delete
padding-top: 3%;
[885] Fix | Delete
}
[886] Fix | Delete
div {
[887] Fix | Delete
text-align: left;
[888] Fix | Delete
margin: 0;
[889] Fix | Delete
padding: 0;
[890] Fix | Delete
display: table-cell;
[891] Fix | Delete
vertical-align: top;
[892] Fix | Delete
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", sans-serif;
[893] Fix | Delete
font-weight: normal;
[894] Fix | Delete
}
[895] Fix | Delete
[896] Fix | Delete
h3 {
[897] Fix | Delete
margin: 0;
[898] Fix | Delete
padding-bottom: 3%;
[899] Fix | Delete
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", sans-serif;
[900] Fix | Delete
font-weight: normal;
[901] Fix | Delete
}
[902] Fix | Delete
a {
[903] Fix | Delete
text-decoration: underline;
[904] Fix | Delete
color: #333 !important;
[905] Fix | Delete
}
[906] Fix | Delete
</style>
[907] Fix | Delete
</head>
[908] Fix | Delete
<body>
[909] Fix | Delete
<div>
[910] Fix | Delete
<h3>
[911] Fix | Delete
<?php
[912] Fix | Delete
esc_html_e( 'Duplicate comment detected; it looks as though you’ve already said that!', 'jetpack' );
[913] Fix | Delete
?>
[914] Fix | Delete
</h3>
[915] Fix | Delete
<a href="javascript:backToComments()"><?php esc_html_e( '&laquo; Back', 'jetpack' ); ?></a>
[916] Fix | Delete
</div>
[917] Fix | Delete
<script type="text/javascript">
[918] Fix | Delete
function backToComments() {
[919] Fix | Delete
const test = regexp => {
[920] Fix | Delete
return regexp.test(navigator.userAgent);
[921] Fix | Delete
};
[922] Fix | Delete
if (test(/chrome|chromium|crios|safari|edg/i)) {
[923] Fix | Delete
history.go(-2);
[924] Fix | Delete
return;
[925] Fix | Delete
}
[926] Fix | Delete
history.back();
[927] Fix | Delete
}
[928] Fix | Delete
</script>
[929] Fix | Delete
[930] Fix | Delete
</body>
[931] Fix | Delete
</html>
[932] Fix | Delete
<?php
[933] Fix | Delete
exit( 0 );
[934] Fix | Delete
}
[935] Fix | Delete
[936] Fix | Delete
/**
[937] Fix | Delete
* POST the submitted comment to the iframe
[938] Fix | Delete
*
[939] Fix | Delete
* @param string $url The comment URL origin.
[940] Fix | Delete
*/
[941] Fix | Delete
public function capture_comment_post_redirect_to_reload_parent_frame( $url ) {
[942] Fix | Delete
if ( ! isset( $_GET['for'] ) || 'jetpack' !== $_GET['for'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
[943] Fix | Delete
return $url;
[944] Fix | Delete
}
[945] Fix | Delete
[946] Fix | Delete
$should_show_subscription_modal = $this->should_show_subscription_modal();
[947] Fix | Delete
[948] Fix | Delete
// Track event when not showing the subscription modal
[949] Fix | Delete
if ( ! $should_show_subscription_modal ) {
[950] Fix | Delete
$this->subscription_modal_status_track_event();
[951] Fix | Delete
}
[952] Fix | Delete
?>
[953] Fix | Delete
<!DOCTYPE html>
[954] Fix | Delete
<html <?php language_attributes(); ?>>
[955] Fix | Delete
<!--<![endif]-->
[956] Fix | Delete
<head>
[957] Fix | Delete
<meta charset="<?php bloginfo( 'charset' ); ?>" />
[958] Fix | Delete
<title>
[959] Fix | Delete
<?php
[960] Fix | Delete
wp_kses_post(
[961] Fix | Delete
printf(
[962] Fix | Delete
/* translators: %s is replaced by an ellipsis */
[963] Fix | Delete
__( 'Submitting Comment%s', 'jetpack' ), // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
[964] Fix | Delete
'&hellip;'
[965] Fix | Delete
)
[966] Fix | Delete
);
[967] Fix | Delete
?>
[968] Fix | Delete
</title>
[969] Fix | Delete
<style type="text/css">
[970] Fix | Delete
body {
[971] Fix | Delete
display: table;
[972] Fix | Delete
width: 100%;
[973] Fix | Delete
height: 60%;
[974] Fix | Delete
position: absolute;
[975] Fix | Delete
top: 0;
[976] Fix | Delete
left: 0;
[977] Fix | Delete
overflow: hidden;
[978] Fix | Delete
color: #333;
[979] Fix | Delete
padding-top: 3%;
[980] Fix | Delete
}
[981] Fix | Delete
[982] Fix | Delete
h3 {
[983] Fix | Delete
text-align: center;
[984] Fix | Delete
margin: 0;
[985] Fix | Delete
padding: 0;
[986] Fix | Delete
display: table-cell;
[987] Fix | Delete
vertical-align: top;
[988] Fix | Delete
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", sans-serif;
[989] Fix | Delete
font-weight: normal;
[990] Fix | Delete
}
[991] Fix | Delete
[992] Fix | Delete
.hidden {
[993] Fix | Delete
opacity: 0;
[994] Fix | Delete
}
[995] Fix | Delete
[996] Fix | Delete
h3 span {
[997] Fix | Delete
-moz-transition-property: opacity;
[998] Fix | Delete
-moz-transition-duration: 1s;
[999] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function