Version Description
- Change the way the 'option_tree_settings' array validates. Strip out those damn slashes!
Download this release
Release Info
Developer | valendesigns |
Plugin | OptionTree |
Version | 2.0.5 |
Comparing to | |
See all releases |
Code changes from version 2.0.4 to 2.0.5
- includes/ot-functions-admin.php +18 -9
- ot-loader.php +2 -2
- readme.txt +5 -2
includes/ot-functions-admin.php
CHANGED
@@ -870,6 +870,7 @@ if ( ! function_exists( 'ot_validate_settings_array' ) ) {
|
|
870 |
/* loop through settings */
|
871 |
foreach( $settings as $k => $setting ) {
|
872 |
|
|
|
873 |
/* remove from array if missing values */
|
874 |
if ( ! $setting['label'] && ! $setting['id'] ) {
|
875 |
|
@@ -877,27 +878,34 @@ if ( ! function_exists( 'ot_validate_settings_array' ) ) {
|
|
877 |
|
878 |
} else {
|
879 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
880 |
/* missing label set to unfiltered ID */
|
881 |
if ( ! $setting['label'] ) {
|
882 |
|
883 |
-
$settings[$k]['label'] =
|
884 |
|
885 |
/* missing ID set to label */
|
886 |
} else if ( ! $setting['id'] ) {
|
887 |
|
888 |
-
$setting['id'] =
|
889 |
|
890 |
}
|
891 |
|
892 |
/* sanitize ID once everything has been checked first */
|
893 |
-
$settings[$k]['id'] = ot_sanitize_option_id( $setting['id'] );
|
894 |
|
895 |
}
|
896 |
|
897 |
-
/* validate
|
898 |
-
if (
|
899 |
|
900 |
-
$settings[$k]['desc'] =
|
901 |
|
902 |
}
|
903 |
|
@@ -917,12 +925,12 @@ if ( ! function_exists( 'ot_validate_settings_array' ) ) {
|
|
917 |
/* missing label set to unfiltered ID */
|
918 |
if ( ! $choice['label'] ) {
|
919 |
|
920 |
-
$setting['choices'][$ck]['label'] =
|
921 |
|
922 |
/* missing value set to label */
|
923 |
} else if ( ! $choice['value'] ) {
|
924 |
|
925 |
-
$setting['choices'][$ck]['value'] = ot_sanitize_option_id( $choice['label'] );
|
926 |
|
927 |
}
|
928 |
|
@@ -946,7 +954,8 @@ if ( ! function_exists( 'ot_validate_settings_array' ) ) {
|
|
946 |
|
947 |
}
|
948 |
|
949 |
-
return
|
|
|
950 |
|
951 |
}
|
952 |
|
870 |
/* loop through settings */
|
871 |
foreach( $settings as $k => $setting ) {
|
872 |
|
873 |
+
|
874 |
/* remove from array if missing values */
|
875 |
if ( ! $setting['label'] && ! $setting['id'] ) {
|
876 |
|
878 |
|
879 |
} else {
|
880 |
|
881 |
+
/* validate label */
|
882 |
+
if ( '' != $setting['label'] ) {
|
883 |
+
|
884 |
+
$settings[$k]['label'] = wp_kses_post( $setting['label'] );
|
885 |
+
|
886 |
+
}
|
887 |
+
|
888 |
/* missing label set to unfiltered ID */
|
889 |
if ( ! $setting['label'] ) {
|
890 |
|
891 |
+
$settings[$k]['label'] = $setting['id'];
|
892 |
|
893 |
/* missing ID set to label */
|
894 |
} else if ( ! $setting['id'] ) {
|
895 |
|
896 |
+
$setting['id'] = wp_kses_post( $setting['label'] );
|
897 |
|
898 |
}
|
899 |
|
900 |
/* sanitize ID once everything has been checked first */
|
901 |
+
$settings[$k]['id'] = ot_sanitize_option_id( wp_kses_post( $setting['id'] ) );
|
902 |
|
903 |
}
|
904 |
|
905 |
+
/* validate description */
|
906 |
+
if ( '' != $setting['desc'] ) {
|
907 |
|
908 |
+
$settings[$k]['desc'] = wp_kses_post( $setting['desc'] );
|
909 |
|
910 |
}
|
911 |
|
925 |
/* missing label set to unfiltered ID */
|
926 |
if ( ! $choice['label'] ) {
|
927 |
|
928 |
+
$setting['choices'][$ck]['label'] = wp_kses_post( $choice['value'] );
|
929 |
|
930 |
/* missing value set to label */
|
931 |
} else if ( ! $choice['value'] ) {
|
932 |
|
933 |
+
$setting['choices'][$ck]['value'] = ot_sanitize_option_id( wp_kses_post( $choice['label'] ) );
|
934 |
|
935 |
}
|
936 |
|
954 |
|
955 |
}
|
956 |
|
957 |
+
/* return array but strip those damn slashes out first!!! */
|
958 |
+
return ot_stripslashes( $settings );
|
959 |
|
960 |
}
|
961 |
|
ot-loader.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: OptionTree
|
4 |
* Plugin URI: http://wp.envato.com
|
5 |
* Description: Theme Options UI Builder for WordPress. A simple way to create & save Theme Options and Meta Boxes for free or premium themes.
|
6 |
-
* Version: 2.0.
|
7 |
* Author: Derek Herman
|
8 |
* Author URI: http://valendesigns.com
|
9 |
* License: GPLv2
|
@@ -63,7 +63,7 @@ if ( ! class_exists( 'OT_Loader' ) ) {
|
|
63 |
/**
|
64 |
* Current Version number.
|
65 |
*/
|
66 |
-
define( 'OT_VERSION', '2.0.
|
67 |
|
68 |
/**
|
69 |
* For developers: Allow Unfiltered HTML in all the textareas.
|
3 |
* Plugin Name: OptionTree
|
4 |
* Plugin URI: http://wp.envato.com
|
5 |
* Description: Theme Options UI Builder for WordPress. A simple way to create & save Theme Options and Meta Boxes for free or premium themes.
|
6 |
+
* Version: 2.0.5
|
7 |
* Author: Derek Herman
|
8 |
* Author URI: http://valendesigns.com
|
9 |
* License: GPLv2
|
63 |
/**
|
64 |
* Current Version number.
|
65 |
*/
|
66 |
+
define( 'OT_VERSION', '2.0.5' );
|
67 |
|
68 |
/**
|
69 |
* For developers: Allow Unfiltered HTML in all the textareas.
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: http://bit.ly/NuXI3T
|
|
4 |
Tags: admin, theme options, meta boxes, options, admin interface, ajax
|
5 |
Requires at least: 3.3
|
6 |
Tested up to: 3.5
|
7 |
-
Stable tag: 2.0.
|
8 |
License: GPLv2
|
9 |
|
10 |
Theme Options UI Builder for WordPress. A simple way to create & save Theme Options and Meta Boxes for free or premium themes.
|
@@ -41,6 +41,9 @@ Yes. OptionTree requires PHP5 to work correctly (so does WP 3.2+).
|
|
41 |
|
42 |
== Changelog ==
|
43 |
|
|
|
|
|
|
|
44 |
= 2.0.4 =
|
45 |
* Run the 'option_tree' array through validation when upgrading from the 1.0 branch to the 2.0 branch for the first time.
|
46 |
* Fix a typo in the slider array where textarea's were not saving the first time due to an incorrect array key.
|
@@ -151,7 +154,7 @@ Yes. OptionTree requires PHP5 to work correctly (so does WP 3.2+).
|
|
151 |
|
152 |
== Upgrade Notice ==
|
153 |
|
154 |
-
= 2.0.
|
155 |
The plugin has undertaken a complete rebuild! If you are not the theme developer, I urge you to contact that person before you upgrade and ask them to test the themes compatibility.
|
156 |
|
157 |
= 1.1.8.1 =
|
4 |
Tags: admin, theme options, meta boxes, options, admin interface, ajax
|
5 |
Requires at least: 3.3
|
6 |
Tested up to: 3.5
|
7 |
+
Stable tag: 2.0.5
|
8 |
License: GPLv2
|
9 |
|
10 |
Theme Options UI Builder for WordPress. A simple way to create & save Theme Options and Meta Boxes for free or premium themes.
|
41 |
|
42 |
== Changelog ==
|
43 |
|
44 |
+
= 2.0.5 =
|
45 |
+
* Change the way the 'option_tree_settings' array validates. Strip out those damn slashes!
|
46 |
+
|
47 |
= 2.0.4 =
|
48 |
* Run the 'option_tree' array through validation when upgrading from the 1.0 branch to the 2.0 branch for the first time.
|
49 |
* Fix a typo in the slider array where textarea's were not saving the first time due to an incorrect array key.
|
154 |
|
155 |
== Upgrade Notice ==
|
156 |
|
157 |
+
= 2.0.5 =
|
158 |
The plugin has undertaken a complete rebuild! If you are not the theme developer, I urge you to contact that person before you upgrade and ask them to test the themes compatibility.
|
159 |
|
160 |
= 1.1.8.1 =
|