Skip to content

Commit

Permalink
fix(esc): fix sksmatt#8
Browse files Browse the repository at this point in the history
  • Loading branch information
Mte90 committed Apr 29, 2021
1 parent 83a2aff commit 232d7eb
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions class.wph-widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ function create_field_text($key, $out = "") {

$value = isset($key['value']) ? $key['value'] : $key['std'];

$out .= 'id="' . esc_attr($key['_id']) . '" name="' . esc_attr($key['_name']) . '" value="' . esc_attr__($value) . '" ';
$out .= 'id="' . esc_attr($key['_id']) . '" name="' . esc_attr($key['_name']) . '" value="' . esc_attr($value) . '" ';

if (isset($key['size'])) {
$out .= 'size="' . esc_attr($key['size']) . '" ';
Expand Down Expand Up @@ -507,7 +507,7 @@ function create_field_select($key, $out = "") {
$selected = isset($key['value']) ? $key['value'] : $key['std'];

foreach ($key['fields'] as $field => $option) {
$out .= '<option value="' . esc_attr__($option['value']) . '" ';
$out .= '<option value="' . esc_attr($option['value']) . '" ';

if (esc_attr($selected) == $option['value']) {
$out .= ' selected="selected" ';
Expand Down Expand Up @@ -591,7 +591,7 @@ function create_field_number($key, $out = "") {

$value = isset($key['value']) ? $key['value'] : $key['std'];

$out .= 'id="' . esc_attr($key['_id']) . '" name="' . esc_attr($key['_name']) . '" value="' . esc_attr__($value) . '" ';
$out .= 'id="' . esc_attr($key['_id']) . '" name="' . esc_attr($key['_name']) . '" value="' . esc_attr($value) . '" ';

if (isset($key['size'])) {
$out .= 'size="' . esc_attr($key['size']) . '" ';
Expand Down Expand Up @@ -642,7 +642,7 @@ function create_field_taxonomy($key, $out = "") {
$taxonomy = get_taxonomy($tax);
$posttypes_obj = $taxonomy->object_type;
foreach ($posttypes_obj as $posttype_obj => $posttype) {
$out .= '<option value="' . esc_attr__($taxonomy->name) . '" ';
$out .= '<option value="' . esc_attr($taxonomy->name) . '" ';
if (esc_attr($selected) == $taxonomy->name) {
$out .= ' selected="selected" ';
}
Expand Down Expand Up @@ -689,7 +689,7 @@ function create_field_taxonomyterm($key, $out = "") {
$out .= '>Any Categories</option>';
foreach ($terms as $term) {
//make array as pattern ( $term->taxonomy , $term->name);
$out .= '<option value="' . esc_attr__($term->slug) . '" ';
$out .= '<option value="' . esc_attr($term->slug) . '" ';
if (esc_attr($selected) == $term->slug) {
$out .= ' selected="selected" ';
}
Expand All @@ -700,7 +700,7 @@ function create_field_taxonomyterm($key, $out = "") {
) );

foreach ($subterms as $subterm) {
$out .= '<option value="' . esc_attr__($subterm->slug) . '" ';
$out .= '<option value="' . esc_attr($subterm->slug) . '" ';
if (esc_attr($selected) == $subterm->slug) {
$out .= ' selected="selected" ';
}
Expand Down Expand Up @@ -734,7 +734,7 @@ function create_field_pages($key, $out = "") {
$selected = isset($key['value']) ? $key['value'] : $key['std'];
$pages = get_pages('sort_column=post_parent,menu_order');
foreach ($pages as $page) {
$out .= '<option value="' . esc_attr__($page->ID) . '" ';
$out .= '<option value="' . esc_attr($page->ID) . '" ';
if (esc_attr($selected) == $page->ID) {
$out .= ' selected="selected" ';
}
Expand Down Expand Up @@ -772,7 +772,7 @@ function create_field_posttype($key, $out = "") {
);
$options_posts_obj = get_posts($args);
foreach ($options_posts_obj as $field_ID) {
$out .= '<option value="' . esc_attr__($field_ID->ID) . '" ';
$out .= '<option value="' . esc_attr($field_ID->ID) . '" ';
if (esc_attr($selected) == $field_ID->ID) {
$out .= ' selected="selected" ';
}
Expand All @@ -797,7 +797,7 @@ function create_field_posttype($key, $out = "") {
function create_field_hidden($key, $out = "") {
$out .= '<input type="hidden" ';
$value = isset($key['value']) ? $key['value'] : $key['std'];
$out .= 'id="' . esc_attr($key['_id']) . '" name="' . esc_attr($key['_name']) . '" value="' . esc_attr__($value) . '" ';
$out .= 'id="' . esc_attr($key['_id']) . '" name="' . esc_attr($key['_name']) . '" value="' . esc_attr($value) . '" ';
$out .= ' />';
return $out;
}
Expand Down

0 comments on commit 232d7eb

Please sign in to comment.