PluginProbe ʕ •ᴥ•ʔ
Secure Custom Fields / 6.4.0-beta2
Secure Custom Fields v6.4.0-beta2
6.9.5 6.9.4 6.9.3 6.9.2 6.9.1 6.9.0 6.8.9 6.8.7 6.8.8 6.8.6 6.8.4 6.8.5 trunk 6.4.0-beta1 6.4.0-beta2 6.4.1 6.4.1-beta3 6.4.1-beta4 6.4.1-beta5 6.4.1-beta6 6.4.1-beta7 6.4.2 6.5.0 6.5.1 6.5.2 6.5.3 6.5.4 6.5.5 6.5.6 6.5.7 6.6.0 6.7.0 6.7.1 6.8.0 6.8.1 6.8.2 6.8.3
secure-custom-fields / includes / admin / views / escaped-html-notice.php
secure-custom-fields / includes / admin / views Last commit date
acf-field-group 1 year ago acf-post-type 1 year ago acf-taxonomy 1 year ago global 1 year ago tools 1 year ago upgrade 1 year ago browse-fields-modal.php 1 year ago escaped-html-notice.php 1 year ago index.php 1 year ago
escaped-html-notice.php
69 lines
1 <?php
2
3 $acf_plugin_name = 'ACF PRO';
4 $acf_plugin_name = '<strong>' . $acf_plugin_name . ' &mdash;</strong>';
5 $acf_learn_how_to_fix = '<a href="' . 'https://www.advancedcustomfields.com/escaping-the-field/' . '" target="_blank">' . __( 'Learn&nbsp;more', 'acf' ) . '</a>';
6 $acf_class = 'notice-error';
7 $acf_user_can_acf = false;
8
9 if ( current_user_can( acf_get_setting( 'capability' ) ) ) {
10 $acf_user_can_acf = true;
11 $acf_dismiss_url = add_query_arg( array( 'acf-dismiss-esc-html-notice' => wp_create_nonce( 'acf/dismiss_escaped_html_notice' ) ) );
12
13 // "Show/Hide Details" is a button for accessibility purposes, because it isn't a link. But since the design shows a link, we need to make it look like a link.
14 $acf_style_button_as_link = trim(
15 'display: inline;
16 padding: 0;
17 background: none;
18 border: none;
19 color: #0073aa;
20 text-decoration: underline;
21 cursor: pointer;'
22 );
23
24 $acf_show_details = '<button style="' . esc_attr( $acf_style_button_as_link ) . '" class="acf-show-more-details">' . __( 'Show&nbsp;details', 'acf' ) . '</button>';
25 $acf_show_details .= ' | <a class="acf-dismiss-permanently-button" href="' . esc_url( $acf_dismiss_url ) . '">' . __( 'Dismiss permanently', 'acf' ) . '</a>';
26 } else {
27 $acf_show_details = __( 'Please contact your site administrator or developer for more details.', 'acf' );
28 }
29
30 $acf_error_msg = sprintf(
31 /* translators: %1$s - name of the ACF plugin. %2$s - Link to documentation. */
32 __( '%1$s ACF now automatically escapes unsafe HTML when rendered by <code>the_field</code> or the ACF shortcode. We\'ve detected the output of some of your fields has been modified by this change, but this may not be a breaking change. %2$s.', 'acf' ),
33 $acf_plugin_name,
34 $acf_learn_how_to_fix
35 );
36
37
38 ?>
39 <div class="acf-admin-notice notice acf-escaped-html-notice <?php echo esc_attr( $acf_class ); ?>">
40 <p style="margin-bottom: 0.5em; padding-bottom: 2px;"><?php echo acf_esc_html( $acf_error_msg ); ?></p>
41 <p style="margin: 0.5em 0; padding: 2px;"><?php echo acf_esc_html( $acf_show_details ); ?></p>
42 <?php if ( $acf_user_can_acf && ! empty( $acf_escaped ) ) : ?>
43 <div class="acf-error-details" style="display: none; list-style: disc; margin-left: 14px;">
44 <ul class="acf-error-details" style="display: none; list-style: disc; margin-left: 14px;">
45 <?php
46 foreach ( $acf_escaped as $acf_field_key => $acf_data ) {
47 $acf_error = sprintf(
48 /* translators: %1$s - The selector used %2$s The field name 3%$s The parent function name */
49 __( '%1$s (%2$s) - rendered via %3$s', 'acf' ),
50 $acf_data['selector'],
51 $acf_data['field'],
52 $acf_data['function']
53 );
54
55 echo '<li>' . esc_html( $acf_error ) . '</li>';
56 }
57 ?>
58 </ul>
59 <p style="margin: 0.5em 0; padding: 2px;">
60 <?php
61 $acf_clear_logs_url = add_query_arg( array( 'acf-clear-esc-html-log' => wp_create_nonce( 'acf/clear_escaped_html_log' ) ) );
62 // translators: %s - The clear log button opening HTML tag. %s - The closing HTML tag.
63 echo acf_esc_html( '<i>' . sprintf( __( 'This data is logged as we detect values that have been changed during output. %1$sClear log and dismiss%2$s after escaping the values in your code. The notice will reappear if we detect changed values again.', 'acf' ), '<a class="acf-clear-log-button" href="' . esc_url( $acf_clear_logs_url ) . '">', '</a>' ) . '</i>' );
64 ?>
65 </p>
66 </div>
67 <?php endif; ?>
68 </div>
69