| @@ -333,12 +333,13 @@ | ||
| 333 | 333 | $option = $option_field[ urldecode( $key ) ]; |
| 334 | 334 | if ( 3 === (int) $option['means'] || 4 === (int) $option['means'] ) { |
| 335 | 335 | if ( is_array( $value ) ) { |
| 336 | 336 | foreach ( $value as $k => $v ) { |
| 337 | - $pots[ $key ][ trim( $v ) ] = trim( $v ); | |
| 337 | + $v = trim( wel_safe_text_serialize( $v ) ); | |
| 338 | + $pots[ $key ][ $v ] = $v; | |
| 338 | 339 | } |
| 339 | 340 | } else { |
| 340 | - $pots[ $key ] = $value; | |
| 341 | + $pots[ $key ] = wel_safe_text_serialize( $value ); | |
| 341 | 342 | } |
| 342 | 343 | } else { |
| 343 | 344 | if ( is_array( $value ) ) { |
| 344 | 345 | foreach ( $value as $k => $v ) { |
| @@ -379,12 +380,13 @@ | ||
| 379 | 380 | if ( isset( $_POST['itemOption'][ $index ][ $id ][ $sku ] ) && is_array( $_POST['itemOption'][ $index ][ $id ][ $sku ] ) ) { |
| 380 | 381 | foreach ( $_POST['itemOption'][ $index ][ $id ][ $sku ] as $key => $value ) { |
| 381 | 382 | if ( is_array( $value ) ) { |
| 382 | 383 | foreach ( $value as $k => $v ) { |
| 384 | + $v = wel_safe_text_serialize( $v ); | |
| 383 | 385 | $pots[ $key ][ $v ] = $v; |
| 384 | 386 | } |
| 385 | 387 | } else { |
| 386 | - $pots[ $key ] = $value; | |
| 388 | + $pots[ $key ] = wel_safe_text_serialize( $value ); | |
| 387 | 389 | } |
| 388 | 390 | } |
| 389 | 391 | ksort( $pots ); |
| 390 | 392 | $sels[ $id ][ $sku ] = $pots; |
| @@ -401,9 +403,9 @@ | ||
| 401 | 403 | * @param string $serial Serial key. |
| 402 | 404 | * @return array|false False if the serial key cannot be restored ( unserialize failure or invalid format ). |
| 403 | 405 | */ |
| 404 | 406 | public function key_unserialize( $serial ) { |
| 405 | - $array = @unserialize( $serial ); | |
| 407 | + $array = wel_safe_unserialize( $serial ); | |
| 406 | 408 | if ( ! is_array( $array ) || empty( $array ) ) { |
| 407 | 409 | return false; |
| 408 | 410 | } |
| 409 | 411 | $ids = array_keys( $array ); |
| @@ -565,14 +567,18 @@ | ||
| 565 | 567 | } |
| 566 | 568 | |
| 567 | 569 | if ( isset( $_POST['reserve'] ) ) { |
| 568 | 570 | foreach ( $_POST['reserve'] as $key => $value ) { |
| 569 | - $_SESSION['usces_entry']['reserve'][ $key ] = trim( $value ); | |
| 571 | + $_SESSION['usces_entry']['reserve'][ $key ] = trim( wel_safe_text_serialize( $value ) ); | |
| 570 | 572 | } |
| 571 | 573 | } |
| 572 | 574 | if ( isset( $_POST['custom_order'] ) ) { |
| 573 | 575 | unset( $_SESSION['usces_entry']['custom_order'] ); |
| 576 | + $csod_meta = usces_has_custom_field_meta( 'order' ); | |
| 574 | 577 | foreach ( $_POST['custom_order'] as $key => $value ) { |
| 578 | + if ( ! is_array( $csod_meta ) || ! isset( $csod_meta[ $key ] ) ) { | |
| 579 | + continue; | |
| 580 | + } | |
| 575 | 581 | $value = wel_safe_text_serialize( $value ); |
| 576 | 582 | if ( is_array( $value ) ) { |
| 577 | 583 | foreach ( $value as $k => $v ) { |
| 578 | 584 | $_SESSION['usces_entry']['custom_order'][ $key ][ trim( $v ) ] = trim( $v ); |