Skip to content

Instantly share code, notes, and snippets.

@lgladdy
Last active January 30, 2024 17:23
Show Gist options
  • Save lgladdy/e4cb5816c835b11dd2d8f482b16fdcb6 to your computer and use it in GitHub Desktop.
Save lgladdy/e4cb5816c835b11dd2d8f482b16fdcb6 to your computer and use it in GitHub Desktop.

Revisions

  1. lgladdy revised this gist Jan 17, 2024. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion acf-unsafe-html-detection-backtrace.php
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@
    add_action( 'acf/will_remove_unsafe_html', 'print_backtrace_for_unsafe_html_removal', 10, 4 );
    add_action( 'acf/removed_unsafe_html', 'print_backtrace_for_unsafe_html_removal', 10, 4 );
    function print_backtrace_for_unsafe_html_removal( $function, $selector, $field_object, $post_id ) {
    echo '<h4 style="color:red">Detected Potentially Unsafe HTML Removal</h4>';
    echo '<h4 style="color:red">Detected Potentially Unsafe HTML Modification</h4>';
    echo '<pre>';
    debug_print_backtrace();
    echo '</pre>';
  2. lgladdy created this gist Jan 17, 2024.
    9 changes: 9 additions & 0 deletions acf-unsafe-html-detection-backtrace.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    <?php
    add_action( 'acf/will_remove_unsafe_html', 'print_backtrace_for_unsafe_html_removal', 10, 4 );
    add_action( 'acf/removed_unsafe_html', 'print_backtrace_for_unsafe_html_removal', 10, 4 );
    function print_backtrace_for_unsafe_html_removal( $function, $selector, $field_object, $post_id ) {
    echo '<h4 style="color:red">Detected Potentially Unsafe HTML Removal</h4>';
    echo '<pre>';
    debug_print_backtrace();
    echo '</pre>';
    }