| @@ -8580,9 +8580,8 @@ | ||
| 8580 | 8580 | } |
| 8581 | 8581 | |
| 8582 | 8582 | public function get_animation_class($data, $object) |
| 8583 | 8583 | { |
| 8584 | - // Disable if mobile + disable-mobile setting | |
| 8585 | 8584 | if ( |
| 8586 | 8585 | 'overlay' !== $object && |
| 8587 | 8586 | 'yes' === ($data[$object . '_animation_disable_mobile'] ?? '') && |
| 8588 | 8587 | wp_is_mobile() |
| @@ -8589,18 +8588,18 @@ | ||
| 8589 | 8588 | ) { |
| 8590 | 8589 | return ''; |
| 8591 | 8590 | } |
| 8592 | 8591 | |
| 8593 | - $class = ''; | |
| 8594 | - $anim = $data[$object . '_animation'] ?? 'none'; | |
| 8592 | + $animation = Grid_Ajax_Security::sanitize_animation($data[$object . '_animation'] ?? 'none'); | |
| 8593 | + if ('none' === $animation) { | |
| 8594 | + return ''; | |
| 8595 | + } | |
| 8595 | 8596 | |
| 8596 | - if ('none' !== $anim) { | |
| 8597 | - $class .= ' king-addons-' . $object . '-' . $anim; | |
| 8598 | - $class .= ' king-addons-anim-size-' . ($data[$object . '_animation_size'] ?? ''); | |
| 8599 | - $class .= ' king-addons-animation-timing-' . ($data[$object . '_animation_timing'] ?? ''); | |
| 8600 | - if ('yes' === ($data[$object . '_animation_tr'] ?? '')) { | |
| 8601 | - $class .= ' king-addons-anim-transparency'; | |
| 8602 | - } | |
| 8597 | + $class = ' king-addons-' . sanitize_html_class((string) $object) . '-' . $animation; | |
| 8598 | + $class .= ' king-addons-anim-size-' . Grid_Ajax_Security::sanitize_animation_size($data[$object . '_animation_size'] ?? 'large'); | |
| 8599 | + $class .= ' king-addons-animation-timing-' . Grid_Ajax_Security::sanitize_animation_timing($data[$object . '_animation_timing'] ?? 'ease-default'); | |
| 8600 | + if ('yes' === Grid_Ajax_Security::sanitize_yes_no_switcher($data[$object . '_animation_tr'] ?? '')) { | |
| 8601 | + $class .= ' king-addons-anim-transparency'; | |
| 8603 | 8602 | } |
| 8604 | 8603 | return $class; |
| 8605 | 8604 | } |
| 8606 | 8605 | |
| @@ -8605,30 +8604,18 @@ | ||
| 8605 | 8604 | } |
| 8606 | 8605 | |
| 8607 | 8606 | public function get_image_effect_class($settings) |
| 8608 | 8607 | { |
| 8609 | - // Restrict effects if premium not available | |
| 8610 | - if ( | |
| 8611 | - !king_addons_freemius()->can_use_premium_code__premium_only() && | |
| 8612 | - in_array($settings['image_effects'], ['pro-zi', 'pro-zo', 'pro-go', 'pro-bo']) | |
| 8613 | - ) { | |
| 8614 | - $settings['image_effects'] = 'none'; | |
| 8615 | - } | |
| 8616 | - | |
| 8608 | + $effect = Grid_Ajax_Security::sanitize_image_effect($settings['image_effects'] ?? 'none'); | |
| 8617 | 8609 | $class = ''; |
| 8618 | - $effect = $settings['image_effects'] ?? 'none'; | |
| 8619 | - | |
| 8620 | 8610 | if ('none' !== $effect) { |
| 8621 | 8611 | $class .= ' king-addons-' . $effect; |
| 8622 | 8612 | } |
| 8623 | - | |
| 8624 | - // For 'slide' vs other effect directions | |
| 8625 | 8613 | if ('slide' !== $effect) { |
| 8626 | - $class .= ' king-addons-effect-size-' . ($settings['image_effects_size'] ?? ''); | |
| 8614 | + $class .= ' king-addons-effect-size-' . Grid_Ajax_Security::sanitize_image_effect_size($settings['image_effects_size'] ?? 'medium'); | |
| 8627 | 8615 | } else { |
| 8628 | - $class .= ' king-addons-effect-dir-' . ($settings['image_effects_direction'] ?? ''); | |
| 8616 | + $class .= ' king-addons-effect-dir-' . Grid_Ajax_Security::sanitize_image_effect_direction($settings['image_effects_direction'] ?? 'bottom'); | |
| 8629 | 8617 | } |
| 8630 | - | |
| 8631 | 8618 | return $class; |
| 8632 | 8619 | } |
| 8633 | 8620 | |
| 8634 | 8621 | public function render_password_protected_input() |