PluginProbe
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster / 2.3.0
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster v2.3.0
2.6.0 trunk 1.1.0 1.1.4 1.2.1 1.2.2 1.2.3 1.2.5 1.2.9 1.3.1 1.3.2 1.5.0 1.5.1 1.5.4 1.5.7 1.5.8 1.5.9 1.6.2 1.6.5 1.6.8 1.7.2 1.7.4 1.7.5 1.7.9 1.8.1 All 42 releases
← All changes | includes/functions.php +8 -2 1.2.22.3.0 View file →
@@ -117,10 +117,16 @@
117 117 * @SuppressWarnings(PHPMD.NPathComplexity)
118 118 * @param array $conditions Conditions data.
119 119 */
120 120 function sellkit_conditions_validation( $conditions ) {
121 - $is_valid = true;
122 - $condition_type = ! empty( $conditions[1]['type'] ) ? $conditions[1]['type'] : 'and';
121 + $is_valid = true;
122 +
123 + if ( empty( $conditions ) ) {
124 + return true;
125 + }
126 +
127 + $first_condition = reset( $conditions );
128 + $condition_type = ! empty( $first_condition['type'] ) ? $first_condition['type'] : 'and';
123 129
124 130 if ( 'or' === $condition_type ) {
125 131 $is_valid = false;
126 132 }