Changes between Initial Version and Version 1 of Ticket #45067, comment 13
- Timestamp:
- 10/17/2018 08:26:55 AM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #45067, comment 13
initial v1 6 6 The first thing `do_shortcode_tag()` (from `preg_replace_callback( "/$pattern/", 'do_shortcode_tag', $attr, -1, $count );`) does is to check if the shortcode was "escaped" by using `[[` and `]]`. If it is, it strips the extra `[` and `]` and returns the remaining shortcode without executing the callback for it. Then the shortcode output is additionally filtered with `wp_kses_one_attr( $new_attr, $elname );`. 7 7 8 The failing test is for escaped shortcode `[[gallery]]`, so the expected behavior is to get `[gallery]` back. That's what happens, however until now the whole `background:url([gallery])` was stripped by `safecss_filter_attr()`, and because of8 The failing test is for escaped shortcode `[[gallery]]`, so the expected behavior is to get `[gallery]` back. That's what happens, however until now the whole `background:url([gallery])` was stripped by `safecss_filter_attr()`, i.e. `$new_attr` was an empty string, and because of 9 9 {{{ 10 10 if ( '' !== trim( $new_attr ) ) { … … 14 14 }}} 15 15 16 the `$attr` remained unchanged (it's safe as it already haspassed through kses when saving) and no shortcode is "executed".16 the `$attr` remained unchanged (it's safe as it has already passed through kses when saving) and no shortcode is "executed". 17 17 18 After the patch here we keep `background:url(*)` which is replaced in the above code and shows as test error when in fact is the proper output. 19 18 After the patch here we keep `background:url(*)` CSS values, so `$new_attr` is not empty any more. So `$attr` gets set to `$new_attr` in the above code, and shows as test error when in fact is the proper output.