Skip to content

Commit adb4579

Browse files
committed
Don't encode shortcode contents on (un)trash. Props Andrew Ozz (@azaozz).
1 parent 14f8d8a commit adb4579

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Make sure your theme's `footer.php` file has `<?php wp_footer(); ?>` somewhere i
5858
= Version 3.1.13 =
5959

6060
* Fix setting sanitization bug. Props Alexander Concha (@xknown).
61+
* Don't encode shortcode contents on (un)trash. Props Andrew Ozz (@azaozz).
6162

6263
= Version 3.1.12 =
6364

syntaxhighlighter.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,13 +406,16 @@ function encode_shortcode_contents_slashed_noquickedit( $content ) {
406406
// In certain weird circumstances, the content gets run through "content_save_pre" twice
407407
// Keep track and don't allow this filter to be run twice
408408
// I couldn't easily figure out why this happens and didn't bother looking into it further as this works fine
409-
if ( true == $this->content_save_pre_ran )
409+
if ( true == $this->content_save_pre_ran ) {
410410
return $content;
411+
}
411412
$this->content_save_pre_ran = true;
412413

413414
// Post quick edits aren't decoded for display, so we don't need to encode them (again)
414-
if ( ! empty( $_POST ) && !empty( $_POST['action'] ) && 'inline-save' == $_POST['action'] )
415+
// This also aborts for (un)trashing to avoid extra encoding.
416+
if ( empty( $_POST ) || ( ! empty( $_POST['action'] ) && 'inline-save' == $_POST['action'] ) ) {
415417
return $content;
418+
}
416419

417420
return $this->encode_shortcode_contents_slashed( $content );
418421
}

0 commit comments

Comments
 (0)