| @@ -9,9 +9,9 @@ | ||
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | 11 | * Example converter base impoprter template for bbPress |
| 12 | 12 | * |
| 13 | - * @since 2.3.0 bbPress (r4689) | |
| 13 | + * @since 2.4.0 bbPress (r5014) | |
| 14 | 14 | * |
| 15 | 15 | * @link Codex Docs https://codex.bbpress.org/import-forums/custom-import |
| 16 | 16 | */ |
| 17 | 17 | class Example extends BBP_Converter_Base { |
| @@ -697,9 +697,9 @@ | ||
| 697 | 697 | */ |
| 698 | 698 | public function callback_savepass( $field, $row ) { |
| 699 | 699 | $pass_array = array( |
| 700 | 700 | 'hash' => $field, |
| 701 | - 'salt' => $row['salt'] | |
| 701 | + 'salt' => isset( $row['salt'] ) ? wp_slash( (string) $row['salt'] ) : '' | |
| 702 | 702 | ); |
| 703 | 703 | |
| 704 | 704 | return $pass_array; |
| 705 | 705 | } |
| @@ -710,18 +710,12 @@ | ||
| 710 | 710 | */ |
| 711 | 711 | public function authenticate_pass( $password, $serialized_pass ) { |
| 712 | 712 | |
| 713 | 713 | // Unserialize the password, with safeguards |
| 714 | - $pass_array = unserialize( | |
| 715 | - $serialized_pass, | |
| 716 | - array( | |
| 717 | - 'allowed_classes' => false, | |
| 718 | - 'max_depth' => 1 | |
| 719 | - ) | |
| 720 | - ); | |
| 714 | + $pass_array = $this->unserialize_pass( $serialized_pass ); | |
| 721 | 715 | |
| 722 | 716 | // Bail if missing values |
| 723 | - if ( ! is_array( $pass_array ) || ! isset( $pass_array['hash'], $pass_array['salt'] ) ) { | |
| 717 | + if ( ! is_string( $password ) || ! is_array( $pass_array ) || ! isset( $pass_array['hash'], $pass_array['salt'] ) || ! is_string( $pass_array['hash'] ) || ! is_string( $pass_array['salt'] ) ) { | |
| 724 | 718 | return false; |
| 725 | 719 | } |
| 726 | 720 | |
| 727 | 721 | // Return comparison |