Skip to content

Commit c5f564a

Browse files
committed
Fix for multicheck sanitization. Props @bryanfarris.
1 parent 62520a9 commit c5f564a

File tree

4 files changed

+25
-17
lines changed

4 files changed

+25
-17
lines changed

includes/class-options-interface.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,8 @@ static function optionsframework_fields() {
245245
if ( $typography_options['sizes'] ) {
246246
$font_size = '<select class="of-typography of-typography-size" name="' . esc_attr( $option_name . '[' . $value['id'] . '][size]' ) . '" id="' . esc_attr( $value['id'] . '_size' ) . '">';
247247
$sizes = $typography_options['sizes'];
248-
foreach ( $sizes as $i ) {
249-
$size = $i . 'px';
248+
foreach ( $sizes as $size ) {
249+
$size = $size . 'px';
250250
$font_size .= '<option value="' . esc_attr( $size ) . '" ' . selected( $typography_stored['size'], $size, false ) . '>' . esc_html( $size ) . '</option>';
251251
}
252252
$font_size .= '</select>';
@@ -419,4 +419,4 @@ static function optionsframework_fields() {
419419
}
420420
}
421421

422-
}
422+
}

includes/class-options-sanitization.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ function of_sanitize_checkbox( $input ) {
7878
* @return array of sanitized values ('1' or false)
7979
*/
8080
function of_sanitize_multicheck( $input, $option ) {
81-
$output = '';
81+
$output = array();
8282
if ( is_array( $input ) ) {
8383
foreach( $option['options'] as $key => $value ) {
8484
$output[$key] = false;
@@ -451,4 +451,4 @@ function of_validate_hex( $hex ) {
451451
else {
452452
return true;
453453
}
454-
}
454+
}

readme.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
**Tags:** options, theme options
44
**Requires at least:** 3.6
5-
**Tested up to:** 4.4.1
5+
**Tested up to:** 4.9.4
66
**Stable tag:** 1.8.5
77
**License:** GPLv2
88
**Donate link:** http://bit.ly/options-donate-2
@@ -32,13 +32,13 @@ The Options Framework Plugin makes it easy to include an options panel in any Wo
3232

3333
### Learn More
3434

35-
Please visit [http://wptheming.com/options-framework-plugin](http://wptheming.com/options-framework-plugin) for a full description of how to define and use the theme options.
35+
Please visit [https://wptheming.com/options-framework-plugin](https://wptheming.com/options-framework-plugin) for a full description of how to define and use the theme options.
3636

3737
### Installation
3838

3939
If your theme already has options enabled, they will show up under the appearance menu.
4040

41-
If your theme doesn't have options, you can define them to options.php of your theme and they will instantly show up. For more on how to do this, visit [http://wptheming.com/options-framework-plugin](http://wptheming.com/options-framework-plugin).
41+
If your theme doesn't have options, you can define them to options.php of your theme and they will instantly show up. For more on how to do this, visit [https://wptheming.com/options-framework-plugin](https://wptheming.com/options-framework-plugin).
4242

4343
## Frequently Asked Questions
4444

@@ -48,10 +48,14 @@ Download the development version from GitHub [https://github.com/devinsays/optio
4848

4949
The "Options Check" theme is a blueprint for how to work with options. It includes an example of every option available in the panel and sample output in the theme.
5050

51-
You can also watch the video screencast I have at [http://wptheming.com/options-framework-plugin](http://wptheming.com/options-framework-plugin).
51+
You can also watch the video screencast I have at [https://wptheming.com/options-framework-plugin](https://wptheming.com/options-framework-plugin).
5252

5353
## Changelog
5454

55+
#### Development
56+
57+
* Fix: of_sanitize_multicheck should return an array
58+
5559
#### 1.8.5
5660

5761
* Update: Style headers to look nice in WordPress 4.4
@@ -229,4 +233,4 @@ You can also watch the video screencast I have at [http://wptheming.com/options-
229233

230234
#### 0.1.0
231235

232-
* Initial release
236+
* Initial release

readme.txt

+11-7
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Contributors: downstairsdev
44
Tags: options, theme options
55
Donate link: http://bit.ly/options-donate-2
66
Requires at least: 3.6
7-
Tested up to: 4.4.1
7+
Tested up to: 4.9.4
88
Stable tag: 1.8.5
99
License: GPLv2
1010

@@ -29,13 +29,13 @@ The Options Framework Plugin makes it easy to include an options panel in any Wo
2929

3030
= Learn More =
3131

32-
Please visit [http://wptheming.com/options-framework-plugin](http://wptheming.com/options-framework-plugin) for a full description of how to define and use the theme options.
32+
Please visit [https://wptheming.com/options-framework-plugin](https://wptheming.com/options-framework-plugin) for a full description of how to define and use the theme options.
3333

3434
== Installation ==
3535

3636
If your theme already has options enabled, they will show up under the appearance menu.
3737

38-
If your theme doesn't have options, you can define them to options.php of your theme and they will instantly show up. For more on how to do this, visit [http://wptheming.com/options-framework-plugin](http://wptheming.com/options-framework-plugin).
38+
If your theme doesn't have options, you can define them to options.php of your theme and they will instantly show up. For more on how to do this, visit [https://wptheming.com/options-framework-plugin](https://wptheming.com/options-framework-plugin).
3939

4040
== Frequently Asked Questions ==
4141

@@ -45,7 +45,7 @@ Download the development version from GitHub [https://github.com/devinsays/optio
4545

4646
The "Options Check" theme is a blueprint for how to work with options. It includes an example of every option available in the panel and sample output in the theme.
4747

48-
You can also watch the video screencast I have at [http://wptheming.com/options-framework-plugin](http://wptheming.com/options-framework-plugin).
48+
You can also watch the video screencast I have at [https://wptheming.com/options-framework-plugin](https://wptheming.com/options-framework-plugin).
4949

5050
= What options are available to use? =
5151

@@ -68,7 +68,11 @@ You can also watch the video screencast I have at [http://wptheming.com/options-
6868

6969
== Changelog ==
7070

71-
= 1.8.5 =
71+
= 1.8.6 =
72+
73+
* Fix: of_sanitize_multicheck should return an array
74+
75+
= Development =
7276

7377
* Update: Style headers to look nice in WordPress 4.4
7478

@@ -219,7 +223,7 @@ You can also watch the video screencast I have at [http://wptheming.com/options-
219223
* Updates labels in options-interface.php
220224
* Changes how checkboxes saved in database ("0" or "1")
221225
* Stores typography, backgrounds and multichecks directly as arrays
222-
* For full description, see: http://wptheming.com/2011/05/options-framework-0-6/
226+
* For full description, see: https://wptheming.com/2011/05/options-framework-0-6/
223227

224228
= 0.5.0 =
225229

@@ -245,4 +249,4 @@ You can also watch the video screencast I have at [http://wptheming.com/options-
245249

246250
= 0.1.0 =
247251

248-
* Initial release
252+
* Initial release

0 commit comments

Comments
 (0)