PluginProbe
s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions / 260927
s2Member – Excellent for All Kinds of Memberships, Content Restriction Paywalls & Member Access Subscriptions v260927
260927 260917 260913 260909 260829 260814 260805 110710 110731 110812 110815 110912 110913 110915 110926 110927 111002 111003 111011 111017 111029 111105 111206 111216 111220 All 190 releases
← All changes | src/includes/classes/sc-s-badge-in.inc.php +3 -4 260913 → 260927 View file →
@@ -48,16 +48,15 @@
48 48 do_action('ws_plugin__s2member_before_sc_s_badge', get_defined_vars());
49 49 unset($__refs, $__v);
50 50
51 51 $attr = c_ws_plugin__s2member_utils_strings::trim_qts_deep((array)$attr);
52 -
53 - //251225 Validate attr value.
52 + $attr = shortcode_atts(array('v' => '1'), $attr); // One attribute.
53 +
54 + //260920.1758 Validate the badge version after shortcode defaults are applied, avoiding an undefined-index notice when v is omitted.
54 55 $attr['v'] = (string)(int)$attr['v'];
55 56 if (!in_array($attr['v'], array('1','2','3'), true)) {
56 57 $attr['v'] = '1';
57 58 }
58 -
59 - $attr = shortcode_atts(array('v' => '1'), $attr); // One attribute.
60 59 $code = c_ws_plugin__s2member_utilities::s_badge_gen($attr['v'], FALSE, FALSE);
61 60
62 61 return apply_filters('ws_plugin__s2member_sc_s_badge', $code, get_defined_vars());
63 62 }