| @@ -26,9 +26,9 @@ | ||
| 26 | 26 | if ( empty( $data ) ) { |
| 27 | 27 | return ''; |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - $deli = unserialize( $data['order_delivery'] ); | |
| 30 | + $deli = wel_safe_unserialize( $data['order_delivery'] ); | |
| 31 | 31 | $cart = usces_get_ordercartdata( $order_id ); |
| 32 | 32 | |
| 33 | 33 | $country = $usces->get_order_meta_value( 'customer_country', $order_id ); |
| 34 | 34 | $customer = array( |
| @@ -45,9 +45,9 @@ | ||
| 45 | 45 | 'tel' => $data['order_tel'], |
| 46 | 46 | 'fax' => $data['order_fax'], |
| 47 | 47 | ); |
| 48 | 48 | |
| 49 | - $condition = unserialize( $data['order_condition'] ); | |
| 49 | + $condition = wel_safe_unserialize( $data['order_condition'] ); | |
| 50 | 50 | $tax_display = ( isset( $condition['tax_display'] ) ) ? $condition['tax_display'] : usces_get_tax_display(); |
| 51 | 51 | $reduced_taxrate = ( isset( $condition['applicable_taxrate'] ) && 'reduced' === $condition['applicable_taxrate'] ) ? true : false; |
| 52 | 52 | $usces_tax = null; |
| 53 | 53 | if ( 'activate' === $tax_display && $reduced_taxrate ) { |
| @@ -867,9 +867,9 @@ | ||
| 867 | 867 | $optstr = ''; |
| 868 | 868 | foreach ( $options as $key => $value ) { |
| 869 | 869 | if ( ! empty( $key ) ) { |
| 870 | 870 | $key = urldecode( $key ); |
| 871 | - $value = maybe_unserialize( $value ); | |
| 871 | + $value = wel_safe_maybe_unserialize( $value ); | |
| 872 | 872 | if ( is_array( $value ) ) { |
| 873 | 873 | $c = ''; |
| 874 | 874 | $optstr .= esc_html( $key ) . ' : '; |
| 875 | 875 | foreach ( $value as $v ) { |
| @@ -1177,9 +1177,9 @@ | ||
| 1177 | 1177 | $optstr = ''; |
| 1178 | 1178 | foreach ( $options as $key => $value ) { |
| 1179 | 1179 | if ( ! empty( $key ) ) { |
| 1180 | 1180 | $key = urldecode( $key ); |
| 1181 | - $value = maybe_unserialize( $value ); | |
| 1181 | + $value = wel_safe_maybe_unserialize( $value ); | |
| 1182 | 1182 | if ( is_array( $value ) ) { |
| 1183 | 1183 | $c = ''; |
| 1184 | 1184 | $optstr .= $key . ' : '; |
| 1185 | 1185 | foreach ( $value as $v ) { |
| @@ -1404,9 +1404,9 @@ | ||
| 1404 | 1404 | |
| 1405 | 1405 | $query = $wpdb->prepare( "SELECT `order_check` FROM $table_name WHERE ID = %d", $order_id ); |
| 1406 | 1406 | $res = $wpdb->get_var( $query ); |
| 1407 | 1407 | |
| 1408 | - $checkfield = is_serialized( $res ) ? unserialize( $res ) : array(); | |
| 1408 | + $checkfield = is_serialized( $res ) ? wel_safe_unserialize( $res ) : array(); | |
| 1409 | 1409 | if ( ! isset( $checkfield[ $checked ] ) ) { |
| 1410 | 1410 | $checkfield[ $checked ] = $checked; |
| 1411 | 1411 | } |
| 1412 | 1412 | $logger = Logger::start( $order_id, 'orderedit', 'update' ); |
| @@ -2051,9 +2051,9 @@ | ||
| 2051 | 2051 | |
| 2052 | 2052 | switch ( $custom_field ) { |
| 2053 | 2053 | case 'order': |
| 2054 | 2054 | foreach ( $keys as $key ) { |
| 2055 | - $value = maybe_unserialize( $usces->get_order_meta_value( $cs . $key, $id ) ); | |
| 2055 | + $value = wel_safe_maybe_unserialize( $usces->get_order_meta_value( $cs . $key, $id ) ); | |
| 2056 | 2056 | if ( is_array( $value ) ) { |
| 2057 | 2057 | $concatval = ''; |
| 2058 | 2058 | $c = ''; |
| 2059 | 2059 | foreach ( $value as $v ) { |
| @@ -2063,9 +2063,9 @@ | ||
| 2063 | 2063 | $value = $concatval; |
| 2064 | 2064 | } |
| 2065 | 2065 | $msg_body .= '<tr> |
| 2066 | 2066 | <td style="padding: 0 0 10px; text-align: left; width: 100px; font-weight: normal; vertical-align: text-top;">' . $meta[ $key ]['name'] . '</td> |
| 2067 | - <td style="padding: 0 0 10px 50px; width: calc( 100% - 100px );">' . $value . '</td> | |
| 2067 | + <td style="padding: 0 0 10px 50px; width: calc( 100% - 100px );">' . esc_html( $value ) . '</td> | |
| 2068 | 2068 | </tr>'; |
| 2069 | 2069 | } |
| 2070 | 2070 | break; |
| 2071 | 2071 | |
| @@ -2072,9 +2072,9 @@ | ||
| 2072 | 2072 | case 'customer': |
| 2073 | 2073 | case 'delivery': |
| 2074 | 2074 | foreach ( $keys as $key ) { |
| 2075 | 2075 | if ( $meta[ $key ]['position'] === $position ) { |
| 2076 | - $value = maybe_unserialize( $usces->get_order_meta_value( $cs . $key, $id ) ); | |
| 2076 | + $value = wel_safe_maybe_unserialize( $usces->get_order_meta_value( $cs . $key, $id ) ); | |
| 2077 | 2077 | if ( is_array( $value ) ) { |
| 2078 | 2078 | $concatval = ''; |
| 2079 | 2079 | $c = ''; |
| 2080 | 2080 | foreach ( $value as $v ) { |
| @@ -2084,9 +2084,9 @@ | ||
| 2084 | 2084 | $value = $concatval; |
| 2085 | 2085 | } |
| 2086 | 2086 | $msg_body .= '<tr> |
| 2087 | 2087 | <td style="padding: 0 0 10px; text-align: left; width: 100px; font-weight: normal; vertical-align: text-top;">' . $meta[ $key ]['name'] . '</td> |
| 2088 | - <td style="padding: 0 0 10px 50px; width: calc( 100% - 100px );">' . $value . '</td> | |
| 2088 | + <td style="padding: 0 0 10px 50px; width: calc( 100% - 100px );">' . esc_html( $value ) . '</td> | |
| 2089 | 2089 | </tr>'; |
| 2090 | 2090 | } |
| 2091 | 2091 | } |
| 2092 | 2092 | break; |
| @@ -2093,9 +2093,9 @@ | ||
| 2093 | 2093 | |
| 2094 | 2094 | case 'member': |
| 2095 | 2095 | foreach ( $keys as $key ) { |
| 2096 | 2096 | if ( $meta[ $key ]['position'] === $position ) { |
| 2097 | - $value = maybe_unserialize( $usces->get_member_meta_value( $cs . $key, $id ) ); | |
| 2097 | + $value = wel_safe_maybe_unserialize( $usces->get_member_meta_value( $cs . $key, $id ) ); | |
| 2098 | 2098 | if ( is_array( $value ) ) { |
| 2099 | 2099 | $concatval = ''; |
| 2100 | 2100 | $c = ''; |
| 2101 | 2101 | foreach ( $value as $v ) { |
| @@ -2105,9 +2105,9 @@ | ||
| 2105 | 2105 | $value = $concatval; |
| 2106 | 2106 | } |
| 2107 | 2107 | $msg_body .= '<tr> |
| 2108 | 2108 | <td style="padding: 0 0 10px; text-align: left; width: 100px; font-weight: normal; vertical-align: text-top;">' . $meta[ $key ]['name'] . '</td> |
| 2109 | - <td style="padding: 0 0 10px 50px; width: calc( 100% - 100px );">' . $value . '</td> | |
| 2109 | + <td style="padding: 0 0 10px 50px; width: calc( 100% - 100px );">' . esc_html( $value ) . '</td> | |
| 2110 | 2110 | </tr>'; |
| 2111 | 2111 | } |
| 2112 | 2112 | } |
| 2113 | 2113 | break; |
| @@ -2119,9 +2119,9 @@ | ||
| 2119 | 2119 | case 'order': |
| 2120 | 2120 | $msg_body .= "\r\n"; |
| 2121 | 2121 | $msg_body .= usces_mail_line( 1, $mailaddress ); |
| 2122 | 2122 | foreach ( $keys as $key ) { |
| 2123 | - $value = maybe_unserialize( $usces->get_order_meta_value( $cs . $key, $id ) ); | |
| 2123 | + $value = wel_safe_maybe_unserialize( $usces->get_order_meta_value( $cs . $key, $id ) ); | |
| 2124 | 2124 | if ( is_array( $value ) ) { |
| 2125 | 2125 | $concatval = ''; |
| 2126 | 2126 | $c = ''; |
| 2127 | 2127 | foreach ( $value as $v ) { |
| @@ -2138,9 +2138,9 @@ | ||
| 2138 | 2138 | case 'customer': |
| 2139 | 2139 | case 'delivery': |
| 2140 | 2140 | foreach ( $keys as $key ) { |
| 2141 | 2141 | if ( $meta[ $key ]['position'] === $position ) { |
| 2142 | - $value = maybe_unserialize( $usces->get_order_meta_value( $cs . $key, $id ) ); | |
| 2142 | + $value = wel_safe_maybe_unserialize( $usces->get_order_meta_value( $cs . $key, $id ) ); | |
| 2143 | 2143 | if ( is_array( $value ) ) { |
| 2144 | 2144 | $concatval = ''; |
| 2145 | 2145 | $c = ''; |
| 2146 | 2146 | foreach ( $value as $v ) { |
| @@ -2156,9 +2156,9 @@ | ||
| 2156 | 2156 | |
| 2157 | 2157 | case 'member': |
| 2158 | 2158 | foreach ( $keys as $key ) { |
| 2159 | 2159 | if ( $meta[ $key ]['position'] === $position ) { |
| 2160 | - $value = maybe_unserialize( $usces->get_member_meta_value( $cs . $key, $id ) ); | |
| 2160 | + $value = wel_safe_maybe_unserialize( $usces->get_member_meta_value( $cs . $key, $id ) ); | |
| 2161 | 2161 | if ( is_array( $value ) ) { |
| 2162 | 2162 | $concatval = ''; |
| 2163 | 2163 | $c = ''; |
| 2164 | 2164 | foreach ( $value as $v ) { |
| @@ -2726,9 +2726,9 @@ | ||
| 2726 | 2726 | $tax_mode = $usces->options['tax_mode']; |
| 2727 | 2727 | $reduced_taxrate = usces_is_reduced_taxrate(); |
| 2728 | 2728 | $tax_rate = ( ! empty( $usces->options['tax_rate'] ) && ! $reduced_taxrate ) ? '(' . $usces->options['tax_rate'] . __( '%', 'usces' ) . ')' : ''; |
| 2729 | 2729 | } else { |
| 2730 | - $condition = maybe_unserialize( $data['order_condition'] ); | |
| 2730 | + $condition = wel_safe_maybe_unserialize( $data['order_condition'] ); | |
| 2731 | 2731 | $tax_mode = ( isset( $condition['tax_mode'] ) ) ? $condition['tax_mode'] : $usces->options['tax_mode']; |
| 2732 | 2732 | if ( isset( $condition['applicable_taxrate'] ) ) { |
| 2733 | 2733 | $reduced_taxrate = ( 'reduced' === $condition['applicable_taxrate'] ) ? true : false; |
| 2734 | 2734 | } else { |
| @@ -2779,9 +2779,9 @@ | ||
| 2779 | 2779 | if ( empty( $data ) || ! array_key_exists( 'order_condition', $data ) ) { |
| 2780 | 2780 | $condition = $usces->get_condition(); |
| 2781 | 2781 | $tax_mode = $usces->options['tax_mode']; |
| 2782 | 2782 | } else { |
| 2783 | - $condition = maybe_unserialize( $data['order_condition'] ); | |
| 2783 | + $condition = wel_safe_maybe_unserialize( $data['order_condition'] ); | |
| 2784 | 2784 | $tax_mode = ( isset( $condition['tax_mode'] ) ) ? $condition['tax_mode'] : $usces->options['tax_mode']; |
| 2785 | 2785 | } |
| 2786 | 2786 | |
| 2787 | 2787 | if ( 'exclude' === $tax_mode ) { |
| @@ -2810,9 +2810,9 @@ | ||
| 2810 | 2810 | 'shipping_charge' => $data['order_shipping_charge'], |
| 2811 | 2811 | 'cod_fee' => $data['order_cod_fee'], |
| 2812 | 2812 | 'use_point' => $data['order_usedpoint'], |
| 2813 | 2813 | 'carts' => usces_get_ordercartdata( $data['ID'] ), |
| 2814 | - 'condition' => unserialize( $data['order_condition'] ), | |
| 2814 | + 'condition' => wel_safe_unserialize( $data['order_condition'] ), | |
| 2815 | 2815 | ); |
| 2816 | 2816 | $tax_str = '( ' . usces_crform( usces_internal_tax( $materials, 'return' ), true, false, 'return' ) . ' )'; |
| 2817 | 2817 | } else { |
| 2818 | 2818 | $materials = array(); |