| @@ -9,9 +9,9 @@ | ||
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | 11 | * Implementation of SMF Forum converter. |
| 12 | 12 | * |
| 13 | - * @since 2.5.0 bbPress (r5189) | |
| 13 | + * @since 2.5.0 bbPress (r5191) | |
| 14 | 14 | * |
| 15 | 15 | * @link Codex Docs https://codex.bbpress.org/import-forums/smf |
| 16 | 16 | */ |
| 17 | 17 | class SMF extends BBP_Converter_Base { |
| @@ -667,9 +667,9 @@ | ||
| 667 | 667 | */ |
| 668 | 668 | public function callback_savepass( $field, $row ) { |
| 669 | 669 | $pass_array = array( |
| 670 | 670 | 'hash' => $field, |
| 671 | - 'username' => $row['member_name'] | |
| 671 | + 'username' => isset( $row['member_name'] ) ? wp_slash( (string) $row['member_name'] ) : '' | |
| 672 | 672 | ); |
| 673 | 673 | |
| 674 | 674 | return $pass_array; |
| 675 | 675 | } |
| @@ -678,20 +678,17 @@ | ||
| 678 | 678 | * This method is to take the pass out of the database and compare |
| 679 | 679 | * to a pass the user has typed in. |
| 680 | 680 | */ |
| 681 | 681 | public function authenticate_pass( $password, $serialized_pass ) { |
| 682 | + if ( ! is_string( $serialized_pass ) ) { | |
| 683 | + return false; | |
| 684 | + } | |
| 682 | 685 | |
| 683 | 686 | // Unserialize the password, with safeguards |
| 684 | - $pass_array = unserialize( | |
| 685 | - $serialized_pass, | |
| 686 | - array( | |
| 687 | - 'allowed_classes' => false, | |
| 688 | - 'max_depth' => 1 | |
| 689 | - ) | |
| 690 | - ); | |
| 687 | + $pass_array = $this->unserialize_pass( $serialized_pass ); | |
| 691 | 688 | |
| 692 | - // Bail if missing values | |
| 693 | - if ( ! is_array( $pass_array ) || ! isset( $pass_array['hash'], $pass_array['username'] ) ) { | |
| 689 | + // Bail if missing or invalid values | |
| 690 | + if ( ! is_string( $password ) || ! is_array( $pass_array ) || ! isset( $pass_array['hash'], $pass_array['username'] ) || ! is_string( $pass_array['hash'] ) || ! is_string( $pass_array['username'] ) ) { | |
| 694 | 691 | return false; |
| 695 | 692 | } |
| 696 | 693 | |
| 697 | 694 | // Return comparison |