Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93
/home/sportsfe.../httpdocs/wp-conte.../plugins/wordfenc.../modules/login-se.../classes/model
File: 2fainitializationdata.php
<?php
[0] Fix | Delete
[1] Fix | Delete
namespace WordfenceLS;
[2] Fix | Delete
[3] Fix | Delete
class Model_2faInitializationData {
[4] Fix | Delete
[5] Fix | Delete
private $user;
[6] Fix | Delete
private $raw_secret;
[7] Fix | Delete
private $base32_secret;
[8] Fix | Delete
private $otp_url;
[9] Fix | Delete
private $recovery_codes;
[10] Fix | Delete
[11] Fix | Delete
public function __construct($user) {
[12] Fix | Delete
$this->user = $user;
[13] Fix | Delete
$this->raw_secret = Model_Crypto::random_bytes(20);
[14] Fix | Delete
}
[15] Fix | Delete
[16] Fix | Delete
public function get_user() {
[17] Fix | Delete
return $this->user;
[18] Fix | Delete
}
[19] Fix | Delete
[20] Fix | Delete
public function get_raw_secret() {
[21] Fix | Delete
return $this->raw_secret;
[22] Fix | Delete
}
[23] Fix | Delete
[24] Fix | Delete
public function get_base32_secret() {
[25] Fix | Delete
if ($this->base32_secret === null)
[26] Fix | Delete
$this->base32_secret = Utility_BaseConversion::base32_encode($this->raw_secret);
[27] Fix | Delete
return $this->base32_secret;
[28] Fix | Delete
}
[29] Fix | Delete
[30] Fix | Delete
private function generate_otp_url() {
[31] Fix | Delete
return "otpauth://totp/" . rawurlencode(preg_replace('~^https?://(?:www\.)?~i', '', home_url()) . ':' . $this->user->user_login) . '?secret=' . $this->get_base32_secret() . '&algorithm=SHA1&digits=6&period=30&issuer=' . rawurlencode(preg_replace('~^https?://(?:www\.)?~i', '', home_url()));
[32] Fix | Delete
}
[33] Fix | Delete
[34] Fix | Delete
public function get_otp_url() {
[35] Fix | Delete
if ($this->otp_url === null)
[36] Fix | Delete
$this->otp_url = $this->generate_otp_url();
[37] Fix | Delete
return $this->otp_url;
[38] Fix | Delete
}
[39] Fix | Delete
[40] Fix | Delete
public function get_recovery_codes() {
[41] Fix | Delete
if ($this->recovery_codes === null)
[42] Fix | Delete
$this->recovery_codes = Controller_Users::shared()->regenerate_recovery_codes();
[43] Fix | Delete
return $this->recovery_codes;
[44] Fix | Delete
}
[45] Fix | Delete
[46] Fix | Delete
}
[47] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function