mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-08 17:07:03 +03:00
Small fixes
This commit is contained in:
parent
b68a56cf6b
commit
5a762f5066
8 changed files with 61 additions and 20 deletions
|
|
@ -1594,7 +1594,7 @@ class ImapClient extends \MailSo\Net\NetClient
|
|||
$aResult = $aParams;
|
||||
if (\is_array($aResult) && 2 === count($aResult))
|
||||
{
|
||||
$aResult[1] = '"*******"';
|
||||
$aResult[1] = '"********"';
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,6 +23,11 @@ class Logger extends \MailSo\Base\Collection
|
|||
*/
|
||||
private $aSecretWords;
|
||||
|
||||
/**
|
||||
* @var bool
|
||||
*/
|
||||
private $bShowSecter;
|
||||
|
||||
/**
|
||||
* @access protected
|
||||
*/
|
||||
|
|
@ -33,6 +38,7 @@ class Logger extends \MailSo\Base\Collection
|
|||
$this->bUsed = false;
|
||||
$this->aForbiddenTypes = array();
|
||||
$this->aSecretWords = array();
|
||||
$this->bShowSecter = false;
|
||||
|
||||
\register_shutdown_function(array(&$this, '__loggerShutDown'));
|
||||
}
|
||||
|
|
@ -87,6 +93,7 @@ class Logger extends \MailSo\Base\Collection
|
|||
|
||||
/**
|
||||
* @param string $sWord
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function AddSecret($sWord)
|
||||
|
|
@ -94,10 +101,30 @@ class Logger extends \MailSo\Base\Collection
|
|||
if (0 < \strlen(\trim($sWord)))
|
||||
{
|
||||
$this->aSecretWords[] = $sWord;
|
||||
$this->aSecretWords = array_unique($this->aSecretWords);
|
||||
$this->aSecretWords = \array_unique($this->aSecretWords);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $bShow
|
||||
*
|
||||
* @return \MailSo\Log\Logger
|
||||
*/
|
||||
public function SetShowSecter($bShow)
|
||||
{
|
||||
$this->bShowSecter = !!$bShow;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function IsShowSecter()
|
||||
{
|
||||
return $this->bShowSecter;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $iType
|
||||
*
|
||||
|
|
@ -176,7 +203,7 @@ class Logger extends \MailSo\Base\Collection
|
|||
$aLoggers = array();
|
||||
$iResult = 1;
|
||||
|
||||
if ($bSearchWords && 0 < \count($this->aSecretWords))
|
||||
if ($bSearchWords && !$this->bShowSecter && 0 < \count($this->aSecretWords))
|
||||
{
|
||||
$sDesc = \str_replace($this->aSecretWords, '*******', $sDesc);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -334,6 +334,12 @@ abstract class NetClient
|
|||
|
||||
$bFake = 0 < \strlen($sFakeRaw);
|
||||
$sRaw .= "\r\n";
|
||||
|
||||
if ($this->oLogger && $this->oLogger->IsShowSecter())
|
||||
{
|
||||
$bFake = false;
|
||||
}
|
||||
|
||||
if ($bFake)
|
||||
{
|
||||
$sFakeRaw .= "\r\n";
|
||||
|
|
|
|||
|
|
@ -256,7 +256,7 @@ class Pop3Client extends \MailSo\Net\NetClient
|
|||
switch ($sCommand)
|
||||
{
|
||||
case 'PASS':
|
||||
$sResult = '*******';
|
||||
$sResult = '********';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -155,7 +155,7 @@ class PoppassdClient extends \MailSo\Net\NetClient
|
|||
{
|
||||
case 'pass':
|
||||
case 'newpass':
|
||||
$sResult = '*******';
|
||||
$sResult = '********';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -570,7 +570,7 @@ class SmtpClient extends \MailSo\Net\NetClient
|
|||
$sCommand = \trim($sCommand);
|
||||
$sRealCommand = $sCommand.(0 === \strlen($sAddToCommand) ? '' : ' '.$sAddToCommand);
|
||||
|
||||
$sFakeCommand = ($bSecureLog) ? '**********' : '';
|
||||
$sFakeCommand = ($bSecureLog) ? '********' : '';
|
||||
|
||||
$this->iRequestTime = \microtime(true);
|
||||
$this->sendRaw($sRealCommand, true, $sFakeCommand);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue