| @@ -16,8 +16,16 @@ | ||
| 16 | 16 | */ |
| 17 | 17 | class phpBB extends BBP_Converter_Base { |
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | + * Main Constructor | |
| 21 | + * | |
| 22 | + */ | |
| 23 | + public function __construct() { | |
| 24 | + parent::__construct(); | |
| 25 | + } | |
| 26 | + | |
| 27 | + /** | |
| 20 | 28 | * Sets up the field mappings |
| 21 | 29 | */ |
| 22 | 30 | public function setup_globals() { |
| 23 | 31 | |
| @@ -132,24 +140,24 @@ | ||
| 132 | 140 | // Forum dates. |
| 133 | 141 | $this->field_map[] = array( |
| 134 | 142 | 'to_type' => 'forum', |
| 135 | 143 | 'to_fieldname' => 'post_date', |
| 136 | - 'default' => date( 'Y-m-d H:i:s' ) // phpcs:ignore | |
| 144 | + 'default' => date( 'Y-m-d H:i:s' ) // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date | |
| 137 | 145 | ); |
| 138 | 146 | $this->field_map[] = array( |
| 139 | 147 | 'to_type' => 'forum', |
| 140 | 148 | 'to_fieldname' => 'post_date_gmt', |
| 141 | - 'default' => gmdate( 'Y-m-d H:i:s' ) | |
| 149 | + 'default' => date( 'Y-m-d H:i:s' ) // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date | |
| 142 | 150 | ); |
| 143 | 151 | $this->field_map[] = array( |
| 144 | 152 | 'to_type' => 'forum', |
| 145 | 153 | 'to_fieldname' => 'post_modified', |
| 146 | - 'default' => date( 'Y-m-d H:i:s' ) // phpcs:ignore | |
| 154 | + 'default' => date( 'Y-m-d H:i:s' ) // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date | |
| 147 | 155 | ); |
| 148 | 156 | $this->field_map[] = array( |
| 149 | 157 | 'to_type' => 'forum', |
| 150 | 158 | 'to_fieldname' => 'post_modified_gmt', |
| 151 | - 'default' => gmdate( 'Y-m-d H:i:s' ) | |
| 159 | + 'default' => date( 'Y-m-d H:i:s' ) // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date | |
| 152 | 160 | ); |
| 153 | 161 | |
| 154 | 162 | /** Forum Subscriptions Section ***************************************/ |
| 155 | 163 | |
| @@ -756,9 +764,9 @@ | ||
| 756 | 764 | $itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; |
| 757 | 765 | |
| 758 | 766 | // Compare using private crypt |
| 759 | 767 | return hash_equals( |
| 760 | - $this->hash_crypt_private( $password, $pass_array['hash'], $itoa64 ), | |
| 768 | + $this->_hash_crypt_private( $password, $pass_array['hash'], $itoa64 ), | |
| 761 | 769 | $pass_array['hash'] |
| 762 | 770 | ); |
| 763 | 771 | } |
| 764 | 772 | |
| @@ -777,9 +785,9 @@ | ||
| 777 | 785 | * @return bool True if the password is correct, false if not. |
| 778 | 786 | */ |
| 779 | 787 | private function authenticate_combined_pass( $password, $matches ) { |
| 780 | 788 | $itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'; |
| 781 | - $phpass_hash = $this->hash_crypt_private( $password, '$' . $matches[1] . '$' . $matches[3], $itoa64 ); | |
| 789 | + $phpass_hash = $this->_hash_crypt_private( $password, '$' . $matches[1] . '$' . $matches[3], $itoa64 ); | |
| 782 | 790 | $bcrypt_hash = '$' . $matches[2] . '$' . $matches[4] . '$' . $matches[5] . $matches[6]; |
| 783 | 791 | |
| 784 | 792 | return password_verify( substr( $phpass_hash, 12 ), $bcrypt_hash ); |
| 785 | 793 | } |
| @@ -786,9 +794,9 @@ | ||
| 786 | 794 | |
| 787 | 795 | /** |
| 788 | 796 | * The crypt function/replacement |
| 789 | 797 | */ |
| 790 | - private function hash_crypt_private( $password, $setting, &$itoa64 ) { | |
| 798 | + private function _hash_crypt_private( $password, $setting, &$itoa64 ) { | |
| 791 | 799 | $output = '*'; |
| 792 | 800 | |
| 793 | 801 | // Check for correct hash |
| 794 | 802 | if ( ! in_array( substr( $setting, 0, 3 ), array( '$H$', '$P$' ), true ) ) { |
| @@ -828,9 +836,9 @@ | ||
| 828 | 836 | } while ( --$count ); |
| 829 | 837 | } |
| 830 | 838 | |
| 831 | 839 | $output = substr( $setting, 0, 12 ); |
| 832 | - $output .= $this->hash_encode64( $hash, 16, $itoa64 ); | |
| 840 | + $output .= $this->_hash_encode64( $hash, 16, $itoa64 ); | |
| 833 | 841 | |
| 834 | 842 | return $output; |
| 835 | 843 | } |
| 836 | 844 | |
| @@ -836,9 +844,9 @@ | ||
| 836 | 844 | |
| 837 | 845 | /** |
| 838 | 846 | * Encode hash |
| 839 | 847 | */ |
| 840 | - private function hash_encode64( $input, $count, &$itoa64 ) { | |
| 848 | + private function _hash_encode64( $input, $count, &$itoa64 ) { | |
| 841 | 849 | $output = ''; |
| 842 | 850 | $i = 0; |
| 843 | 851 | |
| 844 | 852 | do { |