PluginProbe
Welcart e-Commerce / 2.12.4
Welcart e-Commerce v2.12.4
2.12.4 2.12.3 2.11.35 2.12.2 2.12.1 2.11.34 2.11.33 2.11.32 2.11.31 2.11.30 1.3.16 1.3.17 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 All 292 releases
← All changes | functions/function.php +22 -14 2.11.342.12.4 View file →
@@ -377,9 +377,13 @@
377 377 }
378 378 }
379 379
380 380 if ( ! empty( $_POST['custom_order'] ) ) {
381 + $csod_meta = usces_has_custom_field_meta( 'order' );
381 382 foreach ( $_POST['custom_order'] as $key => $value ) {
383 + if ( ! is_array( $csod_meta ) || ! isset( $csod_meta[ $key ] ) ) {
384 + continue;
385 + }
382 386 $csod_key = 'csod_' . $key;
383 387 if ( is_array( $value ) ) {
384 388 $value = serialize( $value );
385 389 }
@@ -760,9 +764,9 @@
760 764
761 765 $order_table_name = $wpdb->prefix . 'usces_order';
762 766 $query = $wpdb->prepare( "SELECT order_cart FROM $order_table_name WHERE ID = %d", $order_id );
763 767 $order_cart = $wpdb->get_var( $query );
764 - $cart = unserialize( $order_cart );
768 + $cart = wel_safe_unserialize( $order_cart );
765 769 foreach ( $cart as $cart_index => $cart_row ) {
766 770 $options = array();
767 771 if ( ! empty( $cart_row['options'] ) ) {
768 772 foreach ( $cart_row['options'] as $key => $value ) {
@@ -971,9 +975,9 @@
971 975
972 976 $query = $wpdb->prepare( "SELECT `order_check` FROM $tableName WHERE ID = %d", $order_id );
973 977 $res = $wpdb->get_var( $query );
974 978
975 - $checkfield = ! empty( $res ) ? unserialize( $res ) : array();
979 + $checkfield = ! empty( $res ) ? wel_safe_unserialize( $res ) : array();
976 980 if ( ! is_array( $checkfield ) ) {
977 981 $checkfield = array();
978 982 }
979 983 if ( ! isset( $checkfield[ $checked ] ) ) {
@@ -1065,9 +1069,9 @@
1065 1069
1066 1070 return 1;
1067 1071 }
1068 1072
1069 - $old_deli = unserialize( $old_orderdata->order_delivery );
1073 + $old_deli = wel_safe_unserialize( $old_orderdata->order_delivery );
1070 1074 foreach ( (array) $_POST['delivery'] as $dk => $dv ) {
1071 1075 $old_deli[ $dk ] = $dv;
1072 1076 }
1073 1077 $delivery = serialize( $old_deli );
@@ -1196,9 +1200,13 @@
1196 1200 }
1197 1201 }
1198 1202 $i = 1;
1199 1203 if ( ! empty( $_POST['custom_order'] ) ) {
1204 + $csod_meta = usces_has_custom_field_meta( 'order' );
1200 1205 foreach ( $_POST['custom_order'] as $key => $value ) {
1206 + if ( ! is_array( $csod_meta ) || ! isset( $csod_meta[ $key ] ) ) {
1207 + continue;
1208 + }
1201 1209 $csod_key = 'csod_' . $key;
1202 1210 if ( is_array( $value ) ) {
1203 1211 $value = serialize( $value );
1204 1212 }
@@ -2243,9 +2251,9 @@
2243 2251 function usces_ordered_acting_data( $rand, $key = 'order_received' ) {
2244 2252 global $usces, $wpdb;
2245 2253
2246 2254 $datas = usces_get_order_acting_data( $rand );
2247 - $data = unserialize( $datas['order_data'] );
2255 + $data = wel_safe_unserialize( $datas['order_data'] );
2248 2256 usces_log( 'usces_ordered_acting_data', 'acting_transaction.log' );
2249 2257 $data[ $key ] = 1;
2250 2258
2251 2259 $data = serialize( $data );
@@ -2270,9 +2278,9 @@
2270 2278 function usces_is_trusted_acting_data( $rand ) {
2271 2279 global $usces, $wpdb;
2272 2280
2273 2281 $datas = usces_get_order_acting_data( $rand );
2274 - $data = unserialize( $datas['order_data'] );
2282 + $data = wel_safe_unserialize( $datas['order_data'] );
2275 2283 usces_log( 'usces_is_trusted_acting_data', 'acting_transaction.log' );
2276 2284 if ( isset( $data['propriety'] ) && $data['propriety'] && ! isset( $data['order_received'] ) ) {
2277 2285 return true;
2278 2286 } else {
@@ -2488,9 +2496,9 @@
2488 2496 $sesdata = $usces->cart->get_entry();
2489 2497 if ( isset( $sesdata['order']['ID'] ) && ! empty( $sesdata['order']['ID'] ) ) {
2490 2498 $order_id = $sesdata['order']['ID'];
2491 2499 $data = $usces->get_order_data( $order_id, 'direct' );
2492 - $cart = unserialize( $data['order_cart'] );
2500 + $cart = wel_safe_unserialize( $data['order_cart'] );
2493 2501 $total_price = $usces->get_total_price( $cart ) + $data['order_discount'] - $data['order_usedpoint'];
2494 2502 if ( $total_price < 0 ) {
2495 2503 $total_price = 0;
2496 2504 }
@@ -3242,9 +3250,9 @@
3242 3250 $optstr = '';
3243 3251 foreach ( $options as $key => $value ) {
3244 3252 if ( ! empty( $key ) ) {
3245 3253 $key = urldecode( $key );
3246 - $value = maybe_unserialize( $value );
3254 + $value = wel_safe_maybe_unserialize( $value );
3247 3255 if ( is_array( $value ) ) {
3248 3256 $c = '';
3249 3257 $optstr .= $key . ' : ';
3250 3258 foreach ( $value as $v ) {
@@ -3971,9 +3979,9 @@
3971 3979 }
3972 3980
3973 3981 foreach ( (array) $options as $option ) {
3974 3982 if ( ! isset( $option['flag'] ) ) {
3975 - $meta_value = maybe_unserialize( $option['meta_value'] );
3983 + $meta_value = wel_safe_maybe_unserialize( $option['meta_value'] );
3976 3984 if ( ! is_array( $meta_value ) ) {
3977 3985 $meta_value = (array) $meta_value;
3978 3986 }
3979 3987 $value_str = '';
@@ -4029,9 +4037,9 @@
4029 4037 $html .= '<label for="itemOption[' . $cartmeta_id . ']" class="iopt_label">' . $label . '</label>' . "\n";
4030 4038 switch ( $means ) {
4031 4039 case 0: //Single-select.
4032 4040 $selects = explode( "\n", $field_data['value'] );
4033 - $value = maybe_unserialize( $value );
4041 + $value = wel_safe_maybe_unserialize( $value );
4034 4042 $check_value = array();
4035 4043 if ( ! is_array( $value ) ) {
4036 4044 $check_value = (array) $value;
4037 4045 }
@@ -4071,9 +4079,9 @@
4071 4079 }
4072 4080 break;
4073 4081 case 1: //Multi-select.
4074 4082 $selects = explode( "\n", $field_data['value'] );
4075 - $value = maybe_unserialize( $value );
4083 + $value = wel_safe_maybe_unserialize( $value );
4076 4084 if ( ! is_array( $value ) ) {
4077 4085 $value = (array) $value;
4078 4086 }
4079 4087 $diff = array_diff( (array) $value, $selects );
@@ -4098,9 +4106,9 @@
4098 4106 $html .= '<option value="#NONE#"' . $selected . '>' . __( 'Choose', 'usces' ) . '</option>' . "\n";
4099 4107 }
4100 4108 $i = 0;
4101 4109
4102 - $value_arr = maybe_unserialize( $value );
4110 + $value_arr = wel_safe_maybe_unserialize( $value );
4103 4111
4104 4112 foreach ( $selects as $v ) {
4105 4113 $v = trim( $v );
4106 4114 $opval = urlencode( $v );
@@ -4120,9 +4128,9 @@
4120 4128 $html .= '<input name="itemOption[' . $cartmeta_id . ']" type="text" id="itemOption[' . $cartmeta_id . ']" class="iopt_text" onKeyDown="if (event.keyCode == 13) {return false;}" value="' . esc_attr( $value ) . '" />' . "\n";
4121 4129 break;
4122 4130 case 3: //Radio-button.
4123 4131 $selects = explode( "\n", $field_data['value'] );
4124 - $value = maybe_unserialize( $value );
4132 + $value = wel_safe_maybe_unserialize( $value );
4125 4133 if ( ! is_array( $value ) ) {
4126 4134 $value = (array) $value;
4127 4135 }
4128 4136 $diff = array_diff( $value, $selects );
@@ -4153,9 +4161,9 @@
4153 4161 }
4154 4162 break;
4155 4163 case 4: //Check-box.
4156 4164 $selects = explode( "\n", $field_data['value'] );
4157 - $value = maybe_unserialize( $value );
4165 + $value = wel_safe_maybe_unserialize( $value );
4158 4166 if ( ! is_array( $value ) ) {
4159 4167 $value = (array) $value;
4160 4168 }
4161 4169 $diff = array_diff( (array) $value, $selects );
@@ -4892,9 +4900,9 @@
4892 4900
4893 4901 function usces_get_order_condition( $order_id ) {
4894 4902 global $wpdb;
4895 4903 $order_condition = $wpdb->get_var( $wpdb->prepare( "SELECT order_condition FROM {$wpdb->prefix}usces_order WHERE ID = %d", $order_id ) );
4896 - return maybe_unserialize( $order_condition );
4904 + return wel_safe_maybe_unserialize( $order_condition );
4897 4905 }
4898 4906
4899 4907 function usces_tax_rounding_off( $tax, $tax_method = '' ) {
4900 4908 global $usces;