Version Description
2019-04-11 =
FIX: Encode to UTF-8 when loading HTML
Download this release
Release Info
Developer | buzztone |
Plugin | Contact Form 7 Skins |
Version | 2.1.2 |
Comparing to | |
See all releases |
Code changes from version 2.1.1 to 2.1.2
- includes/admin-visual.php +13 -13
- index.php +2 -2
- readme.txt +6 -2
includes/admin-visual.php
CHANGED
@@ -241,7 +241,7 @@ Class CF7_Skins_Admin_Visual {
|
|
241 |
}
|
242 |
|
243 |
// If item uses selfClosing, append nested children next to it @since 2.1
|
244 |
-
if ( isset( $item->selfClosing ) && $item->selfClosing ) {
|
245 |
$parent->ownerDocument->appendChild( $_item ); // insert after parent
|
246 |
} else {
|
247 |
$parent->appendChild( $_item ); // insert to parent
|
@@ -271,7 +271,7 @@ Class CF7_Skins_Admin_Visual {
|
|
271 |
// outside of a containing element, the DOMDocument will encapsulate that
|
272 |
// text into a paragraph tag (<p>). So we need to encapsulate it with our own tag
|
273 |
// and replace it later in extract_visual()
|
274 |
-
$html->loadHTML( "
|
275 |
|
276 |
foreach ( $html->getElementsByTagName('body')->item(0)->childNodes as $node ) {
|
277 |
$parent = $parent->ownerDocument->importNode( $node, true ); // overwrite
|
@@ -308,16 +308,16 @@ Class CF7_Skins_Admin_Visual {
|
|
308 |
case 'fieldset':
|
309 |
$skin_item = $dom->createElement( 'fieldset' );
|
310 |
$label = isset( $item->cf7sLabel ) ? wp_strip_all_tags( $item->cf7sLabel ) : ''; // validate, set default to empty
|
311 |
-
|
312 |
// Replace "&" to "cf7s&" to avoid "Unterminated Entity Reference" issue,
|
313 |
// and will be replaced back in extract_visual().
|
314 |
// @link https://bugs.php.net/bug.php?id=39521
|
315 |
// @since 0.7.2
|
316 |
-
$label = str_replace( '&', 'cf7s&', $label );
|
317 |
|
318 |
$legend = $dom->createElement( 'legend', $label );
|
319 |
$skin_item->appendChild( $legend );
|
320 |
-
break;
|
321 |
|
322 |
case 'paragraph':
|
323 |
$skin_item = $dom->createElement( 'p' );
|
@@ -368,7 +368,7 @@ Class CF7_Skins_Admin_Visual {
|
|
368 |
// and will be replaced back in extract_visual().
|
369 |
// @link https://bugs.php.net/bug.php?id=39521
|
370 |
// @since 0.7.0
|
371 |
-
$tags = str_replace( '&', 'cf7s&', $tags );
|
372 |
|
373 |
// Create tag helper, will be removed before saving
|
374 |
// Inserted as a child node rather than text for formatting
|
@@ -713,7 +713,7 @@ Class CF7_Skins_Admin_Visual {
|
|
713 |
*
|
714 |
* @since 2.0.0
|
715 |
*/
|
716 |
-
function enqueue_scripts() {
|
717 |
|
718 |
if ( ! CF7_Skins_Admin::edit_page() ) { // return if this is not CF7 editing page
|
719 |
return;
|
@@ -754,11 +754,11 @@ Class CF7_Skins_Admin_Visual {
|
|
754 |
|
755 |
// Add versions @since 2.1
|
756 |
global $wp_version;
|
757 |
-
$versions = array();
|
758 |
$versions['wp'] = $wp_version;
|
759 |
-
$versions['cf7'] = WPCF7_VERSION;
|
760 |
|
761 |
-
// Localize script filter
|
762 |
$localize = apply_filters( 'cf7svisual_localize_script', array(
|
763 |
'ajaxurl' => admin_url('admin-ajax.php'),
|
764 |
'versions' => $versions, // @since 2.1
|
@@ -777,9 +777,9 @@ Class CF7_Skins_Admin_Visual {
|
|
777 |
) );
|
778 |
|
779 |
// Output visual items as a JS var
|
780 |
-
wp_localize_script( 'visual-init', 'cf7svisual', $localize );
|
781 |
}
|
782 |
-
|
783 |
/**
|
784 |
* Copy/duplicate visual form.
|
785 |
*
|
@@ -842,7 +842,7 @@ Class CF7_Skins_Admin_Visual {
|
|
842 |
// console.log(JSON.stringify(cf7svisual,null,2));
|
843 |
</script>
|
844 |
<?php
|
845 |
-
}
|
846 |
|
847 |
} // end class
|
848 |
|
241 |
}
|
242 |
|
243 |
// If item uses selfClosing, append nested children next to it @since 2.1
|
244 |
+
if ( isset( $item->selfClosing ) && $item->selfClosing ) {
|
245 |
$parent->ownerDocument->appendChild( $_item ); // insert after parent
|
246 |
} else {
|
247 |
$parent->appendChild( $_item ); // insert to parent
|
271 |
// outside of a containing element, the DOMDocument will encapsulate that
|
272 |
// text into a paragraph tag (<p>). So we need to encapsulate it with our own tag
|
273 |
// and replace it later in extract_visual()
|
274 |
+
$html->loadHTML( "<?xml encoding='UTF-8' ?><cf7content>$content</cf7content>" );
|
275 |
|
276 |
foreach ( $html->getElementsByTagName('body')->item(0)->childNodes as $node ) {
|
277 |
$parent = $parent->ownerDocument->importNode( $node, true ); // overwrite
|
308 |
case 'fieldset':
|
309 |
$skin_item = $dom->createElement( 'fieldset' );
|
310 |
$label = isset( $item->cf7sLabel ) ? wp_strip_all_tags( $item->cf7sLabel ) : ''; // validate, set default to empty
|
311 |
+
|
312 |
// Replace "&" to "cf7s&" to avoid "Unterminated Entity Reference" issue,
|
313 |
// and will be replaced back in extract_visual().
|
314 |
// @link https://bugs.php.net/bug.php?id=39521
|
315 |
// @since 0.7.2
|
316 |
+
$label = str_replace( '&', 'cf7s&', $label );
|
317 |
|
318 |
$legend = $dom->createElement( 'legend', $label );
|
319 |
$skin_item->appendChild( $legend );
|
320 |
+
break;
|
321 |
|
322 |
case 'paragraph':
|
323 |
$skin_item = $dom->createElement( 'p' );
|
368 |
// and will be replaced back in extract_visual().
|
369 |
// @link https://bugs.php.net/bug.php?id=39521
|
370 |
// @since 0.7.0
|
371 |
+
$tags = str_replace( '&', 'cf7s&', $tags );
|
372 |
|
373 |
// Create tag helper, will be removed before saving
|
374 |
// Inserted as a child node rather than text for formatting
|
713 |
*
|
714 |
* @since 2.0.0
|
715 |
*/
|
716 |
+
function enqueue_scripts() {
|
717 |
|
718 |
if ( ! CF7_Skins_Admin::edit_page() ) { // return if this is not CF7 editing page
|
719 |
return;
|
754 |
|
755 |
// Add versions @since 2.1
|
756 |
global $wp_version;
|
757 |
+
$versions = array();
|
758 |
$versions['wp'] = $wp_version;
|
759 |
+
$versions['cf7'] = WPCF7_VERSION;
|
760 |
|
761 |
+
// Localize script filter
|
762 |
$localize = apply_filters( 'cf7svisual_localize_script', array(
|
763 |
'ajaxurl' => admin_url('admin-ajax.php'),
|
764 |
'versions' => $versions, // @since 2.1
|
777 |
) );
|
778 |
|
779 |
// Output visual items as a JS var
|
780 |
+
wp_localize_script( 'visual-init', 'cf7svisual', $localize );
|
781 |
}
|
782 |
+
|
783 |
/**
|
784 |
* Copy/duplicate visual form.
|
785 |
*
|
842 |
// console.log(JSON.stringify(cf7svisual,null,2));
|
843 |
</script>
|
844 |
<?php
|
845 |
+
}
|
846 |
|
847 |
} // end class
|
848 |
|
index.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Contact Form 7 Skins
|
4 |
* Plugin URI: http://cf7skins.com
|
5 |
* Description: Adds drag & drop Visual Editor with Templates & Styles to Contact Form 7. Requires Contact Form 7.
|
6 |
-
* Version: 2.1.
|
7 |
* Author: Neil Murray
|
8 |
* Author URI: http://cf7skins.com
|
9 |
* License: GPL-2.0+
|
@@ -30,7 +30,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
30 |
*
|
31 |
* @since 0.1.0
|
32 |
*/
|
33 |
-
define( 'CF7SKINS_VERSION', '2.1.
|
34 |
define( 'CF7SKINS_OPTIONS', 'cf7skins' ); // Database option names
|
35 |
define( 'CF7SKINS_TEXTDOMAIN', 'contact-form-7-skins' );
|
36 |
define( 'CF7SKINS_FEATURE_FILTER', false ); // @since 0.4.0
|
3 |
* Plugin Name: Contact Form 7 Skins
|
4 |
* Plugin URI: http://cf7skins.com
|
5 |
* Description: Adds drag & drop Visual Editor with Templates & Styles to Contact Form 7. Requires Contact Form 7.
|
6 |
+
* Version: 2.1.2
|
7 |
* Author: Neil Murray
|
8 |
* Author URI: http://cf7skins.com
|
9 |
* License: GPL-2.0+
|
30 |
*
|
31 |
* @since 0.1.0
|
32 |
*/
|
33 |
+
define( 'CF7SKINS_VERSION', '2.1.2' );
|
34 |
define( 'CF7SKINS_OPTIONS', 'cf7skins' ); // Database option names
|
35 |
define( 'CF7SKINS_TEXTDOMAIN', 'contact-form-7-skins' );
|
36 |
define( 'CF7SKINS_FEATURE_FILTER', false ); // @since 0.4.0
|
readme.txt
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
Contributors: buzztone
|
3 |
Tags: contact form 7, drag & drop form editor, contact form 7 template, contact form 7 style, contact form 7 theme
|
4 |
Requires at least: 4.3
|
5 |
-
Tested up to: 5.
|
6 |
Requires PHP: 5.6
|
7 |
-
Stable tag: 2.1.
|
8 |
Author URI: https://cf7skins.com
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
@@ -122,6 +122,10 @@ Absolutely not. You can create and manage Contact Form 7 forms without any codin
|
|
122 |
|
123 |
== Changelog ==
|
124 |
|
|
|
|
|
|
|
|
|
125 |
= 2.1.1 - 2019-03-04 =
|
126 |
|
127 |
* FIX: Remove opt-in data collection - security fix
|
2 |
Contributors: buzztone
|
3 |
Tags: contact form 7, drag & drop form editor, contact form 7 template, contact form 7 style, contact form 7 theme
|
4 |
Requires at least: 4.3
|
5 |
+
Tested up to: 5.2
|
6 |
Requires PHP: 5.6
|
7 |
+
Stable tag: 2.1.2
|
8 |
Author URI: https://cf7skins.com
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
122 |
|
123 |
== Changelog ==
|
124 |
|
125 |
+
= 2.1.2 - 2019-04-11 =
|
126 |
+
|
127 |
+
* FIX: Encode to UTF-8 when loading HTML
|
128 |
+
|
129 |
= 2.1.1 - 2019-03-04 =
|
130 |
|
131 |
* FIX: Remove opt-in data collection - security fix
|