mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-08 22:18:28 +03:00
strlen() and count() are always 0 = false or more = true
This commit is contained in:
parent
779e7c7685
commit
30bec04a75
50 changed files with 322 additions and 324 deletions
|
|
@ -145,7 +145,7 @@ class Http
|
|||
if ($bWithRemoteUserData)
|
||||
{
|
||||
$sUser = \trim($this->GetServer('REMOTE_USER', ''));
|
||||
$sHost = (0 < \strlen($sUser) ? $sUser.'@' : '').$sHost;
|
||||
$sHost = (\strlen($sUser) ? $sUser.'@' : '').$sHost;
|
||||
}
|
||||
|
||||
if ($bWithoutPort)
|
||||
|
|
@ -189,15 +189,15 @@ class Http
|
|||
CURLOPT_TIMEOUT => (int) $iTimeout
|
||||
);
|
||||
|
||||
if (0 < \strlen($sCustomUserAgent))
|
||||
if (\strlen($sCustomUserAgent))
|
||||
{
|
||||
$aOptions[CURLOPT_USERAGENT] = $sCustomUserAgent;
|
||||
}
|
||||
|
||||
if (0 < \strlen($sProxy))
|
||||
if (\strlen($sProxy))
|
||||
{
|
||||
$aOptions[CURLOPT_PROXY] = $sProxy;
|
||||
if (0 < \strlen($sProxyAuth))
|
||||
if (\strlen($sProxyAuth))
|
||||
{
|
||||
$aOptions[CURLOPT_PROXYUSERPWD] = $sProxyAuth;
|
||||
}
|
||||
|
|
@ -238,7 +238,7 @@ class Http
|
|||
$sNewUrl = null;
|
||||
$sUrl = isset($aOptions[CURLOPT_URL]) ? $aOptions[CURLOPT_URL] : $sUrl;
|
||||
|
||||
if (isset($aOptions[CURLOPT_FOLLOWLOCATION]) && $aOptions[CURLOPT_FOLLOWLOCATION] && 0 < \strlen($sUrl) &&
|
||||
if (isset($aOptions[CURLOPT_FOLLOWLOCATION]) && $aOptions[CURLOPT_FOLLOWLOCATION] && \strlen($sUrl) &&
|
||||
\ini_get('open_basedir') !== '')
|
||||
{
|
||||
$aOptions[CURLOPT_FOLLOWLOCATION] = false;
|
||||
|
|
@ -264,7 +264,7 @@ class Http
|
|||
CURLOPT_TIMEOUT => 5
|
||||
);
|
||||
|
||||
if (isset($aOptions[CURLOPT_HTTPHEADER]) && \is_array($aOptions[CURLOPT_HTTPHEADER]) && 0 < \count($aOptions[CURLOPT_HTTPHEADER]))
|
||||
if (isset($aOptions[CURLOPT_HTTPHEADER]) && \is_array($aOptions[CURLOPT_HTTPHEADER]) && \count($aOptions[CURLOPT_HTTPHEADER]))
|
||||
{
|
||||
$aAddOptions[CURLOPT_HTTPHEADER] = $aOptions[CURLOPT_HTTPHEADER];
|
||||
}
|
||||
|
|
@ -303,7 +303,7 @@ class Http
|
|||
} while ($iCode && --$iRedirectLimit);
|
||||
|
||||
\curl_close($oCurl);
|
||||
if ($iRedirectLimit > 0 && 0 < \strlen($sNewUrl))
|
||||
if ($iRedirectLimit > 0 && \strlen($sNewUrl))
|
||||
{
|
||||
$aOptions[CURLOPT_URL] = $sNewUrl;
|
||||
}
|
||||
|
|
@ -352,21 +352,21 @@ class Http
|
|||
CURLOPT_TIMEOUT => (int) $iTimeout
|
||||
);
|
||||
|
||||
if (0 < \strlen($sCustomUserAgent))
|
||||
if (\strlen($sCustomUserAgent))
|
||||
{
|
||||
$aOptions[CURLOPT_USERAGENT] = $sCustomUserAgent;
|
||||
}
|
||||
|
||||
if (0 < \strlen($sProxy))
|
||||
if (\strlen($sProxy))
|
||||
{
|
||||
$aOptions[CURLOPT_PROXY] = $sProxy;
|
||||
if (0 < \strlen($sProxyAuth))
|
||||
if (\strlen($sProxyAuth))
|
||||
{
|
||||
$aOptions[CURLOPT_PROXYUSERPWD] = $sProxyAuth;
|
||||
}
|
||||
}
|
||||
|
||||
if (0 < \count($aHttpHeaders))
|
||||
if (\count($aHttpHeaders))
|
||||
{
|
||||
$aOptions[CURLOPT_HTTPHEADER] = $aHttpHeaders;
|
||||
}
|
||||
|
|
@ -374,7 +374,7 @@ class Http
|
|||
if ($oLogger)
|
||||
{
|
||||
$oLogger->Write('cUrl: URL: '.$sUrl);
|
||||
// if (isset($aOptions[CURLOPT_HTTPHEADER]) && \is_array($aOptions[CURLOPT_HTTPHEADER]) && 0 < \count($aOptions[CURLOPT_HTTPHEADER]))
|
||||
// if (isset($aOptions[CURLOPT_HTTPHEADER]) && \is_array($aOptions[CURLOPT_HTTPHEADER]) && \count($aOptions[CURLOPT_HTTPHEADER]))
|
||||
// {
|
||||
// $oLogger->Write('cUrl: Headers: '.\print_r($aOptions[CURLOPT_HTTPHEADER], true));
|
||||
// }
|
||||
|
|
@ -436,7 +436,7 @@ class Http
|
|||
\header('Last-Modified: '.\gmdate('D, d M Y H:i:s', $iUtcTimeStamp - $iExpireTime).' UTC');
|
||||
\header('Expires: '.\gmdate('D, j M Y H:i:s', $iUtcTimeStamp + $iExpireTime).' UTC');
|
||||
|
||||
if (0 < strlen($sEtag))
|
||||
if (\strlen($sEtag))
|
||||
{
|
||||
\header('Etag: '.$sEtag);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ class Binary
|
|||
|
||||
public static function GetInlineDecodeOrEncodeFunctionName(string $sContentTransferEncoding, bool $bDecode = true) : string
|
||||
{
|
||||
switch (strtolower($sContentTransferEncoding))
|
||||
switch (\strtolower($sContentTransferEncoding))
|
||||
{
|
||||
case \MailSo\Base\Enumerations\Encoding::BASE64_LOWER:
|
||||
return $bDecode ? 'convert.base64-decode' : 'convert.base64-encode';
|
||||
|
|
@ -104,12 +104,12 @@ class Binary
|
|||
public static function InlineConvertDecode(string $sEncodedString, string &$sEndBuffer, string $sFromEncoding, string $sToEncoding) : string
|
||||
{
|
||||
$sEndBuffer = '';
|
||||
$sQuotedPrintableLen = strlen($sEncodedString);
|
||||
$iLastSpace = strrpos($sEncodedString, ' ');
|
||||
if (false !== $iLastSpace && $iLastSpace + 1 < $sQuotedPrintableLen)
|
||||
$iQuotedPrintableLen = \strlen($sEncodedString);
|
||||
$iLastSpace = \strrpos($sEncodedString, ' ');
|
||||
if (false !== $iLastSpace && $iLastSpace + 1 < $iQuotedPrintableLen)
|
||||
{
|
||||
$sEndBuffer = substr($sEncodedString, $iLastSpace + 1);
|
||||
$sEncodedString = substr($sEncodedString, 0, $iLastSpace + 1);
|
||||
$sEndBuffer = \substr($sEncodedString, $iLastSpace + 1);
|
||||
$sEncodedString = \substr($sEncodedString, 0, $iLastSpace + 1);
|
||||
}
|
||||
return \MailSo\Base\Utils::ConvertEncoding($sEncodedString, $sFromEncoding, $sToEncoding);
|
||||
}
|
||||
|
|
@ -149,17 +149,17 @@ class Binary
|
|||
public static function CreateStream($rStream,
|
||||
string $sUtilsDecodeOrEncodeFunctionName = null, string $sFromEncoding = null, string $sToEncoding = null)
|
||||
{
|
||||
if (!in_array(self::STREAM_NAME, stream_get_wrappers()))
|
||||
if (!\in_array(self::STREAM_NAME, \stream_get_wrappers()))
|
||||
{
|
||||
stream_wrapper_register(self::STREAM_NAME, '\MailSo\Base\StreamWrappers\Binary');
|
||||
\stream_wrapper_register(self::STREAM_NAME, '\MailSo\Base\StreamWrappers\Binary');
|
||||
}
|
||||
|
||||
if (null === $sUtilsDecodeOrEncodeFunctionName || 0 === strlen($sUtilsDecodeOrEncodeFunctionName))
|
||||
if (null === $sUtilsDecodeOrEncodeFunctionName || !\strlen($sUtilsDecodeOrEncodeFunctionName))
|
||||
{
|
||||
$sUtilsDecodeOrEncodeFunctionName = 'InlineNullDecode';
|
||||
}
|
||||
|
||||
$sHashName = md5(microtime(true).rand(1000, 9999));
|
||||
$sHashName = \md5(\microtime(true).\rand(1000, 9999));
|
||||
|
||||
if (null !== $sFromEncoding && null !== $sToEncoding && $sFromEncoding !== $sToEncoding)
|
||||
{
|
||||
|
|
@ -167,7 +167,7 @@ class Binary
|
|||
$sUtilsDecodeOrEncodeFunctionName = 'InlineConvertDecode';
|
||||
}
|
||||
|
||||
if (in_array($sUtilsDecodeOrEncodeFunctionName, array(
|
||||
if (\in_array($sUtilsDecodeOrEncodeFunctionName, array(
|
||||
'convert.base64-decode', 'convert.base64-encode',
|
||||
'convert.quoted-printable-decode', 'convert.quoted-printable-encode'
|
||||
)))
|
||||
|
|
@ -203,17 +203,16 @@ class Binary
|
|||
$this->sToEncoding = null;
|
||||
$this->sFunctionName = null;
|
||||
|
||||
$bResult = false;
|
||||
$aPath = parse_url($sPath);
|
||||
$aPath = \parse_url($sPath);
|
||||
|
||||
if (isset($aPath['host']) && isset($aPath['scheme']) &&
|
||||
0 < strlen($aPath['host']) && 0 < strlen($aPath['scheme']) &&
|
||||
\strlen($aPath['host']) && \strlen($aPath['scheme']) &&
|
||||
self::STREAM_NAME === $aPath['scheme'])
|
||||
{
|
||||
$sHashName = $aPath['host'];
|
||||
if (isset(self::$aStreams[$sHashName]) &&
|
||||
is_array(self::$aStreams[$sHashName]) &&
|
||||
4 === count(self::$aStreams[$sHashName]))
|
||||
\is_array(self::$aStreams[$sHashName]) &&
|
||||
4 === \count(self::$aStreams[$sHashName]))
|
||||
{
|
||||
$this->rStream = self::$aStreams[$sHashName][0];
|
||||
$this->sFunctionName = self::$aStreams[$sHashName][1];
|
||||
|
|
@ -221,10 +220,10 @@ class Binary
|
|||
$this->sToEncoding = self::$aStreams[$sHashName][3];
|
||||
}
|
||||
|
||||
$bResult = is_resource($this->rStream);
|
||||
return \is_resource($this->rStream);
|
||||
}
|
||||
|
||||
return $bResult;
|
||||
return false;
|
||||
}
|
||||
|
||||
public function stream_read(int $iCount) : string
|
||||
|
|
@ -234,29 +233,29 @@ class Binary
|
|||
|
||||
if ($iCount > 0)
|
||||
{
|
||||
if ($iCount < strlen($this->sBuffer))
|
||||
if ($iCount < \strlen($this->sBuffer))
|
||||
{
|
||||
$sReturn = substr($this->sBuffer, 0, $iCount);
|
||||
$this->sBuffer = substr($this->sBuffer, $iCount);
|
||||
$sReturn = \substr($this->sBuffer, 0, $iCount);
|
||||
$this->sBuffer = \substr($this->sBuffer, $iCount);
|
||||
}
|
||||
else
|
||||
{
|
||||
$sReturn = $this->sBuffer;
|
||||
while ($iCount > 0)
|
||||
{
|
||||
if (feof($this->rStream))
|
||||
if (\feof($this->rStream))
|
||||
{
|
||||
if (0 === strlen($this->sBuffer.$sReturn))
|
||||
if (!\strlen($this->sBuffer.$sReturn))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (0 < strlen($this->sReadEndBuffer))
|
||||
if (\strlen($this->sReadEndBuffer))
|
||||
{
|
||||
$sReturn .= self::$sFunctionName($this->sReadEndBuffer,
|
||||
$this->sReadEndBuffer, $this->sFromEncoding, $this->sToEncoding);
|
||||
|
||||
$iDecodeLen = strlen($sReturn);
|
||||
$iDecodeLen = \strlen($sReturn);
|
||||
}
|
||||
|
||||
$iCount = 0;
|
||||
|
|
@ -264,7 +263,7 @@ class Binary
|
|||
}
|
||||
else
|
||||
{
|
||||
$sReadResult = fread($this->rStream, 8192);
|
||||
$sReadResult = \fread($this->rStream, 8192);
|
||||
if (false === $sReadResult)
|
||||
{
|
||||
return false;
|
||||
|
|
@ -273,11 +272,11 @@ class Binary
|
|||
$sReturn .= self::$sFunctionName($this->sReadEndBuffer.$sReadResult,
|
||||
$this->sReadEndBuffer, $this->sFromEncoding, $this->sToEncoding);
|
||||
|
||||
$iDecodeLen = strlen($sReturn);
|
||||
$iDecodeLen = \strlen($sReturn);
|
||||
if ($iCount < $iDecodeLen)
|
||||
{
|
||||
$this->sBuffer = substr($sReturn, $iCount);
|
||||
$sReturn = substr($sReturn, 0, $iCount);
|
||||
$this->sBuffer = \substr($sReturn, $iCount);
|
||||
$sReturn = \substr($sReturn, 0, $iCount);
|
||||
$iCount = 0;
|
||||
}
|
||||
else
|
||||
|
|
@ -288,7 +287,7 @@ class Binary
|
|||
}
|
||||
}
|
||||
|
||||
$this->iPos += strlen($sReturn);
|
||||
$this->iPos += \strlen($sReturn);
|
||||
return $sReturn;
|
||||
}
|
||||
|
||||
|
|
@ -307,7 +306,7 @@ class Binary
|
|||
|
||||
public function stream_eof() : bool
|
||||
{
|
||||
return 0 === strlen($this->sBuffer) && feof($this->rStream);
|
||||
return !\strlen($this->sBuffer) && \feof($this->rStream);
|
||||
}
|
||||
|
||||
public function stream_stat() : array
|
||||
|
|
|
|||
|
|
@ -50,16 +50,16 @@ class Literal
|
|||
*/
|
||||
public static function CreateStream($rStream, int $iLiteralLen)
|
||||
{
|
||||
if (!in_array(self::STREAM_NAME, stream_get_wrappers()))
|
||||
if (!\in_array(self::STREAM_NAME, stream_get_wrappers()))
|
||||
{
|
||||
stream_wrapper_register(self::STREAM_NAME, '\MailSo\Base\StreamWrappers\Literal');
|
||||
\stream_wrapper_register(self::STREAM_NAME, '\MailSo\Base\StreamWrappers\Literal');
|
||||
}
|
||||
|
||||
$sHashName = md5(microtime(true).rand(1000, 9999));
|
||||
$sHashName = \md5(\microtime(true).\rand(1000, 9999));
|
||||
|
||||
self::$aStreams[$sHashName] = array($rStream, $iLiteralLen);
|
||||
|
||||
return fopen(self::STREAM_NAME.'://'.$sHashName, 'rb');
|
||||
return \fopen(self::STREAM_NAME.'://'.$sHashName, 'rb');
|
||||
}
|
||||
|
||||
public function stream_open(string $sPath) : bool
|
||||
|
|
@ -68,26 +68,25 @@ class Literal
|
|||
$this->iSize = 0;
|
||||
$this->rStream = false;
|
||||
|
||||
$bResult = false;
|
||||
$aPath = parse_url($sPath);
|
||||
$aPath = \parse_url($sPath);
|
||||
|
||||
if (isset($aPath['host']) && isset($aPath['scheme']) &&
|
||||
0 < strlen($aPath['host']) && 0 < strlen($aPath['scheme']) &&
|
||||
\strlen($aPath['host']) && \strlen($aPath['scheme']) &&
|
||||
self::STREAM_NAME === $aPath['scheme'])
|
||||
{
|
||||
$sHashName = $aPath['host'];
|
||||
if (isset(self::$aStreams[$sHashName]) &&
|
||||
is_array(self::$aStreams[$sHashName]) &&
|
||||
2 === count(self::$aStreams[$sHashName]))
|
||||
\is_array(self::$aStreams[$sHashName]) &&
|
||||
2 === \count(self::$aStreams[$sHashName]))
|
||||
{
|
||||
$this->rStream = self::$aStreams[$sHashName][0];
|
||||
$this->iSize = self::$aStreams[$sHashName][1];
|
||||
}
|
||||
|
||||
$bResult = is_resource($this->rStream);
|
||||
return \is_resource($this->rStream);
|
||||
}
|
||||
|
||||
return $bResult;
|
||||
return false;
|
||||
}
|
||||
|
||||
public function stream_read(int $iCount) : string
|
||||
|
|
@ -104,7 +103,7 @@ class Literal
|
|||
$iRead = $iCount;
|
||||
while (0 < $iRead)
|
||||
{
|
||||
$sAddRead = fread($this->rStream, $iRead);
|
||||
$sAddRead = \fread($this->rStream, $iRead);
|
||||
if (false === $sAddRead)
|
||||
{
|
||||
$sReadResult = false;
|
||||
|
|
@ -112,8 +111,8 @@ class Literal
|
|||
}
|
||||
|
||||
$sReadResult .= $sAddRead;
|
||||
$iRead -= strlen($sAddRead);
|
||||
$this->iPos += strlen($sAddRead);
|
||||
$iRead -= \strlen($sAddRead);
|
||||
$this->iPos += \strlen($sAddRead);
|
||||
}
|
||||
|
||||
if (false !== $sReadResult)
|
||||
|
|
|
|||
|
|
@ -95,13 +95,13 @@ class SubStreams
|
|||
$aPath = \parse_url($sPath);
|
||||
|
||||
if (isset($aPath['host'], $aPath['scheme']) &&
|
||||
0 < \strlen($aPath['host']) && 0 < \strlen($aPath['scheme']) &&
|
||||
\strlen($aPath['host']) && \strlen($aPath['scheme']) &&
|
||||
self::STREAM_NAME === $aPath['scheme'])
|
||||
{
|
||||
$sHashName = $aPath['host'];
|
||||
if (isset(self::$aStreams[$sHashName]) &&
|
||||
\is_array(self::$aStreams[$sHashName]) &&
|
||||
0 < \count(self::$aStreams[$sHashName]))
|
||||
\count(self::$aStreams[$sHashName]))
|
||||
{
|
||||
$this->iIndex = 0;
|
||||
$this->iPos = 0;
|
||||
|
|
@ -110,7 +110,7 @@ class SubStreams
|
|||
$this->aSubStreams = self::$aStreams[$sHashName];
|
||||
}
|
||||
|
||||
$bResult = 0 < \count($this->aSubStreams);
|
||||
$bResult = \count($this->aSubStreams);
|
||||
}
|
||||
|
||||
return $bResult;
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class TempFile
|
|||
$aPath = parse_url($sPath);
|
||||
|
||||
if (isset($aPath['host']) && isset($aPath['scheme']) &&
|
||||
0 < strlen($aPath['host']) && 0 < strlen($aPath['scheme']) &&
|
||||
\strlen($aPath['host']) && \strlen($aPath['scheme']) &&
|
||||
self::STREAM_NAME === $aPath['scheme'])
|
||||
{
|
||||
$sHashName = $aPath['host'];
|
||||
|
|
|
|||
|
|
@ -39,34 +39,34 @@ class Test
|
|||
*/
|
||||
public static function CreateStream(string $sRawResponse)
|
||||
{
|
||||
if (!in_array(self::STREAM_NAME, stream_get_wrappers()))
|
||||
if (!\in_array(self::STREAM_NAME, \stream_get_wrappers()))
|
||||
{
|
||||
stream_wrapper_register(self::STREAM_NAME, '\MailSo\Base\StreamWrappers\Test');
|
||||
\stream_wrapper_register(self::STREAM_NAME, '\MailSo\Base\StreamWrappers\Test');
|
||||
}
|
||||
|
||||
$sHashName = md5(microtime(true).rand(1000, 9999));
|
||||
$sHashName = \md5(\microtime(true).\rand(1000, 9999));
|
||||
|
||||
$rConnect = fopen('php://memory', 'r+b');
|
||||
fwrite($rConnect, $sRawResponse);
|
||||
fseek($rConnect, 0);
|
||||
$rConnect = \fopen('php://memory', 'r+b');
|
||||
\fwrite($rConnect, $sRawResponse);
|
||||
\fseek($rConnect, 0);
|
||||
|
||||
self::$aStreams[$sHashName] = $rConnect;
|
||||
|
||||
return fopen(self::STREAM_NAME.'://'.$sHashName, 'r+b');
|
||||
return \fopen(self::STREAM_NAME.'://'.$sHashName, 'r+b');
|
||||
}
|
||||
|
||||
public function stream_open(string $sPath) : bool
|
||||
{
|
||||
$bResult = false;
|
||||
$aPath = parse_url($sPath);
|
||||
$aPath = \parse_url($sPath);
|
||||
|
||||
if (isset($aPath['host']) && isset($aPath['scheme']) &&
|
||||
0 < strlen($aPath['host']) && 0 < strlen($aPath['scheme']) &&
|
||||
\strlen($aPath['host']) && \strlen($aPath['scheme']) &&
|
||||
self::STREAM_NAME === $aPath['scheme'])
|
||||
{
|
||||
$sHashName = $aPath['host'];
|
||||
if (isset(self::$aStreams[$sHashName]) &&
|
||||
is_resource(self::$aStreams[$sHashName]))
|
||||
\is_resource(self::$aStreams[$sHashName]))
|
||||
{
|
||||
$this->rReadSream = self::$aStreams[$sHashName];
|
||||
$bResult = true;
|
||||
|
|
@ -78,27 +78,27 @@ class Test
|
|||
|
||||
public function stream_read(int $iCount) : string
|
||||
{
|
||||
return fread($this->rReadSream, $iCount);
|
||||
return \fread($this->rReadSream, $iCount);
|
||||
}
|
||||
|
||||
public function stream_write(string $sInputString) : int
|
||||
{
|
||||
return strlen($sInputString);
|
||||
return \strlen($sInputString);
|
||||
}
|
||||
|
||||
public function stream_tell() : int
|
||||
{
|
||||
return ftell($this->rReadSream);
|
||||
return \ftell($this->rReadSream);
|
||||
}
|
||||
|
||||
public function stream_eof() : bool
|
||||
{
|
||||
return feof($this->rReadSream);
|
||||
return \feof($this->rReadSream);
|
||||
}
|
||||
|
||||
public function stream_stat() : array
|
||||
{
|
||||
return fstat($this->rReadSream);
|
||||
return \fstat($this->rReadSream);
|
||||
}
|
||||
|
||||
public function stream_seek() : bool
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ END;
|
|||
$aSupportedEncodings = \array_map('strtoupper', \array_unique(
|
||||
\array_merge(
|
||||
$aSupportedEncodings,
|
||||
array_merge(
|
||||
\array_merge(
|
||||
...\array_map(
|
||||
'mb_encoding_aliases',
|
||||
$aSupportedEncodings
|
||||
|
|
@ -1005,7 +1005,7 @@ END;
|
|||
$iNow = $iNow ?: \time();
|
||||
$iFileCount = 0;
|
||||
|
||||
$sTempPath = rtrim($sTempPath, '\\/');
|
||||
$sTempPath = \rtrim($sTempPath, '\\/');
|
||||
if (\is_dir($sTempPath))
|
||||
{
|
||||
$rDirH = \opendir($sTempPath);
|
||||
|
|
@ -1055,7 +1055,7 @@ END;
|
|||
{
|
||||
$bResult = true;
|
||||
|
||||
$sTempPath = rtrim($sTempPath, '\\/');
|
||||
$sTempPath = \rtrim($sTempPath, '\\/');
|
||||
if (\is_dir($sTempPath))
|
||||
{
|
||||
$rDirH = \opendir($sTempPath);
|
||||
|
|
@ -1105,7 +1105,7 @@ END;
|
|||
|
||||
public static function Utf8Clear(?string $sUtfString, string $sReplaceOn = '') : string
|
||||
{
|
||||
if (!strlen($sUtfString))
|
||||
if (!\strlen($sUtfString))
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class CacheClient
|
|||
{
|
||||
$iTimer = 0;
|
||||
$sValue = $this->Get($sKey.'/TIMER');
|
||||
if (0 < strlen($sValue) && is_numeric($sValue))
|
||||
if (\strlen($sValue) && is_numeric($sValue))
|
||||
{
|
||||
$iTimer = (int) $sValue;
|
||||
}
|
||||
|
|
@ -116,7 +116,7 @@ class CacheClient
|
|||
|
||||
public function SetCacheIndex(string $sCacheIndex) : self
|
||||
{
|
||||
$this->sCacheIndex = 0 < \strlen($sCacheIndex) ? "\x0".$sCacheIndex : '';
|
||||
$this->sCacheIndex = \strlen($sCacheIndex) ? "\x0".$sCacheIndex : '';
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ abstract class Driver
|
|||
|
||||
protected function getTypedPrefix(int $iType, string $sName = '') : string
|
||||
{
|
||||
$sName = 0 < \strlen($sName) ? $sName : $this->sName;
|
||||
$sName = \strlen($sName) ? $sName : $this->sName;
|
||||
return isset($this->aPrefixes[$iType]) ? $sName.$this->aPrefixes[$iType].': ' : '';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class Logger extends \MailSo\Base\Collection
|
|||
|
||||
public function AddSecret(string $sWord) : void
|
||||
{
|
||||
if (0 < \strlen(\trim($sWord)))
|
||||
if (\strlen(\trim($sWord)))
|
||||
{
|
||||
$this->aSecretWords[] = $sWord;
|
||||
$this->aSecretWords = \array_unique($this->aSecretWords);
|
||||
|
|
@ -181,7 +181,7 @@ class Logger extends \MailSo\Base\Collection
|
|||
$aLoggers = array();
|
||||
$iResult = 1;
|
||||
|
||||
if ($bSearchSecretWords && !$this->bShowSecter && 0 < \count($this->aSecretWords))
|
||||
if ($bSearchSecretWords && !$this->bShowSecter && \count($this->aSecretWords))
|
||||
{
|
||||
$sDesc = \str_replace($this->aSecretWords, '*******', $sDesc);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ class Attachment implements \JsonSerializable
|
|||
{
|
||||
$sFileName = 'calendar'.$this->MimeIndex().'.ics';
|
||||
}
|
||||
else if (0 < \strlen($sMimeType))
|
||||
else if (\strlen($sMimeType))
|
||||
{
|
||||
$sFileName = \str_replace('/', $this->MimeIndex().'.', $sMimeType);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -329,13 +329,13 @@ class Message implements \JsonSerializable
|
|||
\MailSo\Mime\Enumerations\Parameter::CHARSET
|
||||
);
|
||||
|
||||
if (0 < \strlen($sContentTypeCharset))
|
||||
if (\strlen($sContentTypeCharset))
|
||||
{
|
||||
$sCharset = $sContentTypeCharset;
|
||||
$sCharset = \MailSo\Base\Utils::NormalizeCharset($sCharset);
|
||||
}
|
||||
|
||||
if (0 < \strlen($sCharset))
|
||||
if (\strlen($sCharset))
|
||||
{
|
||||
$oHeaders->SetParentCharset($sCharset);
|
||||
}
|
||||
|
|
@ -394,7 +394,7 @@ class Message implements \JsonSerializable
|
|||
{
|
||||
$sPriority = $oHeaders->ValueByName(\MailSo\Mime\Enumerations\Header::X_PRIORITY);
|
||||
}
|
||||
if (0 < \strlen($sPriority))
|
||||
if (\strlen($sPriority))
|
||||
{
|
||||
switch (\str_replace(' ', '', \strtolower($sPriority)))
|
||||
{
|
||||
|
|
@ -485,7 +485,7 @@ class Message implements \JsonSerializable
|
|||
}
|
||||
|
||||
$sDraftInfo = $oHeaders->ValueByName(\MailSo\Mime\Enumerations\Header::X_DRAFT_INFO);
|
||||
if (0 < \strlen($sDraftInfo)) {
|
||||
if (\strlen($sDraftInfo)) {
|
||||
$sType = '';
|
||||
$sFolder = '';
|
||||
$iUid = 0;
|
||||
|
|
@ -506,7 +506,7 @@ class Message implements \JsonSerializable
|
|||
}
|
||||
}
|
||||
|
||||
if (0 < \strlen($sType) && 0 < \strlen($sFolder) && $iUid) {
|
||||
if (\strlen($sType) && \strlen($sFolder) && $iUid) {
|
||||
$this->aDraftInfo = array($sType, $iUid, $sFolder);
|
||||
}
|
||||
}
|
||||
|
|
@ -544,7 +544,7 @@ class Message implements \JsonSerializable
|
|||
$aPgpSignatureParts = $oBodyStructure ? $oBodyStructure->SearchByContentType('application/pgp-signature') : null;
|
||||
if ($this->bPgpSigned = !empty($aPgpSignatureParts)) {
|
||||
$sPgpSignatureText = $oFetchResponse->GetFetchValue(\MailSo\Imap\Enumerations\FetchType::BODY.'['.$aPgpSignatureParts[0]->PartID().']');
|
||||
if (\is_string($sPgpSignatureText) && 0 < \strlen($sPgpSignatureText) && 0 < \strpos($sPgpSignatureText, 'BEGIN PGP SIGNATURE')) {
|
||||
if (\is_string($sPgpSignatureText) && \strlen($sPgpSignatureText) && 0 < \strpos($sPgpSignatureText, 'BEGIN PGP SIGNATURE')) {
|
||||
$this->sPgpSignature = \trim($sPgpSignatureText);
|
||||
$this->sPgpSignatureMicAlg = (string) $oHeaders->ParameterValue(\MailSo\Mime\Enumerations\Header::CONTENT_TYPE, 'micalg');
|
||||
}
|
||||
|
|
@ -572,13 +572,13 @@ class Message implements \JsonSerializable
|
|||
if (null === $sText)
|
||||
{
|
||||
$sText = $oFetchResponse->GetFetchValue(\MailSo\Imap\Enumerations\FetchType::BODY.'['.$oPart->PartID().']<0>');
|
||||
if (\is_string($sText) && 0 < \strlen($sText))
|
||||
if (\is_string($sText) && \strlen($sText))
|
||||
{
|
||||
$this->bTextPartIsTrimmed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (\is_string($sText) && 0 < \strlen($sText))
|
||||
if (\is_string($sText) && \strlen($sText))
|
||||
{
|
||||
$sTextCharset = $oPart->Charset();
|
||||
if (empty($sTextCharset))
|
||||
|
|
@ -608,7 +608,7 @@ class Message implements \JsonSerializable
|
|||
}
|
||||
}
|
||||
|
||||
if (0 < \count($aHtmlParts))
|
||||
if (\count($aHtmlParts))
|
||||
{
|
||||
$this->sHtml = \implode('<br />', $aHtmlParts);
|
||||
}
|
||||
|
|
@ -632,7 +632,7 @@ class Message implements \JsonSerializable
|
|||
if ($oBodyStructure)
|
||||
{
|
||||
$aAttachmentsParts = $oBodyStructure->SearchAttachmentsParts();
|
||||
if ($aAttachmentsParts && 0 < count($aAttachmentsParts))
|
||||
if ($aAttachmentsParts && \count($aAttachmentsParts))
|
||||
{
|
||||
$this->oAttachments = new AttachmentCollection;
|
||||
foreach ($aAttachmentsParts as /* @var $oAttachmentItem \MailSo\Imap\BodyStructure */ $oAttachmentItem)
|
||||
|
|
|
|||
|
|
@ -138,6 +138,6 @@ class Attachment
|
|||
|
||||
public function IsLinked() : bool
|
||||
{
|
||||
return $this->bIsLinked && 0 < \strlen($this->sCID);
|
||||
return $this->bIsLinked && \strlen($this->sCID);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class Email implements \JsonSerializable
|
|||
*/
|
||||
function __construct(string $sEmail, string $sDisplayName = '')
|
||||
{
|
||||
if (!strlen(\trim($sEmail)))
|
||||
if (!\strlen(\trim($sEmail)))
|
||||
{
|
||||
throw new \MailSo\Base\Exceptions\InvalidArgumentException;
|
||||
}
|
||||
|
|
@ -62,7 +62,7 @@ class Email implements \JsonSerializable
|
|||
public static function Parse(string $sEmailAddress) : self
|
||||
{
|
||||
$sEmailAddress = \MailSo\Base\Utils::Trim($sEmailAddress);
|
||||
if (!strlen(\trim($sEmailAddress)))
|
||||
if (!\strlen(\trim($sEmailAddress)))
|
||||
{
|
||||
throw new \MailSo\Base\Exceptions\InvalidArgumentException;
|
||||
}
|
||||
|
|
@ -242,10 +242,10 @@ class Email implements \JsonSerializable
|
|||
}
|
||||
|
||||
$sDisplayName = 0 === \strlen($sDisplayName) ? '' : '"'.$sDisplayName.'"';
|
||||
if (0 < \strlen($this->sEmail))
|
||||
if (\strlen($this->sEmail))
|
||||
{
|
||||
$sReturn = $this->GetEmail($bIdn);
|
||||
if (0 < \strlen($sDisplayName))
|
||||
if (\strlen($sDisplayName))
|
||||
{
|
||||
$sReturn = $sDisplayName.' <'.$sReturn.'>';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,12 +61,12 @@ class Header
|
|||
$this->sEncodedValueForReparse = '';
|
||||
|
||||
$this->oParameters = null;
|
||||
if (0 < \strlen($sEncodedValueForReparse) && $this->IsReparsed())
|
||||
if (\strlen($sEncodedValueForReparse) && $this->IsReparsed())
|
||||
{
|
||||
$this->sEncodedValueForReparse = \trim($sEncodedValueForReparse);
|
||||
}
|
||||
|
||||
if (0 < \strlen($this->sFullValue) && $this->IsParameterized())
|
||||
if (\strlen($this->sFullValue) && $this->IsParameterized())
|
||||
{
|
||||
$aRawExplode = \explode(';', $this->sFullValue, 2);
|
||||
if (2 === \count($aRawExplode))
|
||||
|
|
@ -93,7 +93,7 @@ class Header
|
|||
}
|
||||
|
||||
$aParts = \explode(':', \str_replace("\r", '', $sEncodedLines), 2);
|
||||
if (isset($aParts[0]) && isset($aParts[1]) && 0 < \strlen($aParts[0]) && 0 < \strlen($aParts[1]))
|
||||
if (isset($aParts[0]) && isset($aParts[1]) && \strlen($aParts[0]) && \strlen($aParts[1]))
|
||||
{
|
||||
return new self(
|
||||
\trim($aParts[0]),
|
||||
|
|
@ -128,7 +128,7 @@ class Header
|
|||
|
||||
public function SetParentCharset(string $sParentCharset) : Header
|
||||
{
|
||||
if ($this->sParentCharset !== $sParentCharset && $this->IsReparsed() && 0 < \strlen($this->sEncodedValueForReparse))
|
||||
if ($this->sParentCharset !== $sParentCharset && $this->IsReparsed() && \strlen($this->sEncodedValueForReparse))
|
||||
{
|
||||
$this->initInputData(
|
||||
$this->sName,
|
||||
|
|
@ -221,11 +221,11 @@ class Header
|
|||
{
|
||||
$sValue = $this->Value();
|
||||
if (!\MailSo\Base\Utils::IsAscii($sValue) &&
|
||||
0 < \strlen($this->sEncodedValueForReparse) &&
|
||||
\strlen($this->sEncodedValueForReparse) &&
|
||||
!\MailSo\Base\Utils::IsAscii($this->sEncodedValueForReparse))
|
||||
{
|
||||
$sValueCharset = \MailSo\Base\Utils::CharsetDetect($this->sEncodedValueForReparse);
|
||||
if (0 < \strlen($sValueCharset))
|
||||
if (\strlen($sValueCharset))
|
||||
{
|
||||
$this->SetParentCharset($sValueCharset);
|
||||
$sValue = $this->Value();
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ class HeaderCollection extends \MailSo\Base\Collection
|
|||
{
|
||||
$oResult = null;
|
||||
$sValue = $this->ValueByName($sHeaderName, $bCharsetAutoDetect);
|
||||
if (0 < \strlen($sValue)) {
|
||||
if (\strlen($sValue)) {
|
||||
$oResult = new EmailCollection($sValue);
|
||||
}
|
||||
return $oResult && 0 < $oResult->Count() ? $oResult : null;
|
||||
|
|
@ -144,7 +144,7 @@ class HeaderCollection extends \MailSo\Base\Collection
|
|||
$sName = null;
|
||||
$sValue = null;
|
||||
foreach ($aHeaders as $sHeadersValue) {
|
||||
if (0 === strlen($sHeadersValue)) {
|
||||
if (!\strlen($sHeadersValue)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -218,7 +218,7 @@ class HeaderCollection extends \MailSo\Base\Collection
|
|||
$aResult = array();
|
||||
|
||||
$aHeaders = $this->ValuesByName(Enumerations\Header::AUTHENTICATION_RESULTS);
|
||||
if (0 < \count($aHeaders))
|
||||
if (\count($aHeaders))
|
||||
{
|
||||
foreach ($aHeaders as $sHeaderValue)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ class Message
|
|||
public function SetCustomHeader(string $sHeaderName, string $sValue) : self
|
||||
{
|
||||
$sHeaderName = \trim($sHeaderName);
|
||||
if (0 < \strlen($sHeaderName))
|
||||
if (\strlen($sHeaderName))
|
||||
{
|
||||
$this->aHeadersValue[$sHeaderName] = $sValue;
|
||||
}
|
||||
|
|
@ -220,7 +220,7 @@ class Message
|
|||
break;
|
||||
}
|
||||
|
||||
if (0 < \strlen($sResult))
|
||||
if (\strlen($sResult))
|
||||
{
|
||||
$this->aHeadersValue[Enumerations\Header::X_PRIORITY] = $sResult;
|
||||
}
|
||||
|
|
@ -244,7 +244,7 @@ class Message
|
|||
break;
|
||||
}
|
||||
|
||||
if (0 < \strlen($sResult))
|
||||
if (\strlen($sResult))
|
||||
{
|
||||
$this->aHeadersValue[Enumerations\Header::SENSITIVITY] = $sResult;
|
||||
}
|
||||
|
|
@ -275,7 +275,7 @@ class Message
|
|||
|
||||
public function SetDate(int $iDateTime) : self
|
||||
{
|
||||
$this->aHeadersValue[Enumerations\Header::DATE] = gmdate('r', $iDateTime);
|
||||
$this->aHeadersValue[Enumerations\Header::DATE] = \gmdate('r', $iDateTime);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
|
@ -348,7 +348,7 @@ class Message
|
|||
private function generateNewBoundary() : string
|
||||
{
|
||||
return '--='.\MailSo\Config::$BoundaryPrefix.
|
||||
\rand(100, 999).'_'.rand(100000000, 999999999).'.'.\time();
|
||||
\rand(100, 999).'_'.\rand(100000000, 999999999).'.'.\time();
|
||||
}
|
||||
|
||||
private function generateNewMessageId(string $sHostName = '') : string
|
||||
|
|
@ -384,7 +384,7 @@ class Message
|
|||
$oContentTypeParameters = null;
|
||||
$oContentDispositionParameters = null;
|
||||
|
||||
if (0 < strlen(trim($sFileName)))
|
||||
if (\strlen(\trim($sFileName)))
|
||||
{
|
||||
$oContentTypeParameters =
|
||||
(new ParameterCollection)->Add(new Parameter(
|
||||
|
|
@ -409,14 +409,14 @@ class Message
|
|||
)
|
||||
);
|
||||
|
||||
if (0 < strlen($sCID))
|
||||
if (\strlen($sCID))
|
||||
{
|
||||
$oAttachmentPart->Headers->append(
|
||||
new Header(Enumerations\Header::CONTENT_ID, $sCID)
|
||||
);
|
||||
}
|
||||
|
||||
if (0 < strlen($sContentLocation))
|
||||
if (\strlen($sContentLocation))
|
||||
{
|
||||
$oAttachmentPart->Headers->append(
|
||||
new Header(Enumerations\Header::CONTENT_LOCATION, $sContentLocation)
|
||||
|
|
@ -425,7 +425,7 @@ class Message
|
|||
|
||||
$oAttachmentPart->Body = $oAttachment->Resource();
|
||||
|
||||
if ('message/rfc822' !== strtolower($oAttachment->ContentType()))
|
||||
if ('message/rfc822' !== \strtolower($oAttachment->ContentType()))
|
||||
{
|
||||
$oAttachmentPart->Headers->append(
|
||||
new Header(
|
||||
|
|
@ -434,7 +434,7 @@ class Message
|
|||
)
|
||||
);
|
||||
|
||||
if (is_resource($oAttachmentPart->Body))
|
||||
if (\is_resource($oAttachmentPart->Body))
|
||||
{
|
||||
if (!\MailSo\Base\StreamWrappers\Binary::IsStreamRemembed($oAttachmentPart->Body))
|
||||
{
|
||||
|
|
@ -465,7 +465,7 @@ class Message
|
|||
\MailSo\Base\Enumerations\Charset::UTF_8)
|
||||
);
|
||||
|
||||
if (isset($aAlternativeData[3]) && \is_array($aAlternativeData[3]) && 0 < \count($aAlternativeData[3]))
|
||||
if (isset($aAlternativeData[3]) && \is_array($aAlternativeData[3]) && \count($aAlternativeData[3]))
|
||||
{
|
||||
foreach ($aAlternativeData[3] as $sName => $sValue)
|
||||
{
|
||||
|
|
@ -481,18 +481,18 @@ class Message
|
|||
$oAlternativePart->Body = null;
|
||||
if (isset($aAlternativeData[1]))
|
||||
{
|
||||
if (is_resource($aAlternativeData[1]))
|
||||
if (\is_resource($aAlternativeData[1]))
|
||||
{
|
||||
$oAlternativePart->Body = $aAlternativeData[1];
|
||||
}
|
||||
else if (is_string($aAlternativeData[1]) && 0 < strlen($aAlternativeData[1]))
|
||||
else if (\is_string($aAlternativeData[1]) && \strlen($aAlternativeData[1]))
|
||||
{
|
||||
$oAlternativePart->Body =
|
||||
\MailSo\Base\ResourceRegistry::CreateMemoryResourceFromString($aAlternativeData[1]);
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($aAlternativeData[2]) && 0 < strlen($aAlternativeData[2]))
|
||||
if (isset($aAlternativeData[2]) && \strlen($aAlternativeData[2]))
|
||||
{
|
||||
$oAlternativePart->Headers->append(
|
||||
new Header(Enumerations\Header::CONTENT_TRANSFER_ENCODING,
|
||||
|
|
@ -500,7 +500,7 @@ class Message
|
|||
)
|
||||
);
|
||||
|
||||
if (is_resource($oAlternativePart->Body))
|
||||
if (\is_resource($oAlternativePart->Body))
|
||||
{
|
||||
if (!\MailSo\Base\StreamWrappers\Binary::IsStreamRemembed($oAlternativePart->Body))
|
||||
{
|
||||
|
|
@ -514,7 +514,7 @@ class Message
|
|||
}
|
||||
}
|
||||
|
||||
if (!is_resource($oAlternativePart->Body))
|
||||
if (!\is_resource($oAlternativePart->Body))
|
||||
{
|
||||
$oAlternativePart->Body =
|
||||
\MailSo\Base\ResourceRegistry::CreateMemoryResourceFromString('');
|
||||
|
|
@ -554,7 +554,7 @@ class Message
|
|||
}
|
||||
|
||||
}
|
||||
else if (1 === count($this->aAlternativeParts))
|
||||
else if (1 === \count($this->aAlternativeParts))
|
||||
{
|
||||
$oAlternativePart = $this->createNewMessageAlternativePartBody($this->aAlternativeParts[0]);
|
||||
if ($oAlternativePart)
|
||||
|
|
@ -574,7 +574,7 @@ class Message
|
|||
else
|
||||
{
|
||||
$aAttachments = $this->oAttachmentCollection->getArrayCopy();
|
||||
if (1 === count($aAttachments) && isset($aAttachments[0]))
|
||||
if (1 === \count($aAttachments) && isset($aAttachments[0]))
|
||||
{
|
||||
$this->oAttachmentCollection->Clear();
|
||||
|
||||
|
|
@ -594,7 +594,7 @@ class Message
|
|||
$oResultPart = null;
|
||||
|
||||
$aAttachments = $this->oAttachmentCollection->LinkedAttachments();
|
||||
if (0 < count($aAttachments))
|
||||
if (\count($aAttachments))
|
||||
{
|
||||
$oResultPart = new Part;
|
||||
|
||||
|
|
@ -629,7 +629,7 @@ class Message
|
|||
$oResultPart = null;
|
||||
|
||||
$aAttachments = $this->oAttachmentCollection->UnlinkedAttachments();
|
||||
if (0 < count($aAttachments))
|
||||
if (\count($aAttachments))
|
||||
{
|
||||
$oResultPart = new Part;
|
||||
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ class Parameter
|
|||
public function ToString(bool $bConvertSpecialsName = false) : string
|
||||
{
|
||||
$sResult = '';
|
||||
if (0 < strlen($this->sName))
|
||||
if (\strlen($this->sName))
|
||||
{
|
||||
$sResult = $this->sName.'=';
|
||||
if ($bConvertSpecialsName && in_array(strtolower($this->sName), array(
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class ParameterCollection extends \MailSo\Base\Collection
|
|||
{
|
||||
parent::__construct();
|
||||
|
||||
if (0 < \strlen($sRawParams))
|
||||
if (\strlen($sRawParams))
|
||||
{
|
||||
$this->Parse($sRawParams);
|
||||
}
|
||||
|
|
@ -70,13 +70,13 @@ class ParameterCollection extends \MailSo\Base\Collection
|
|||
foreach ($this as $oParam)
|
||||
{
|
||||
$sLine = $oParam->ToString($bConvertSpecialsName);
|
||||
if (0 < \strlen($sLine))
|
||||
if (\strlen($sLine))
|
||||
{
|
||||
$aResult[] = $sLine;
|
||||
}
|
||||
}
|
||||
|
||||
return 0 < \count($aResult) ? \implode('; ', $aResult) : '';
|
||||
return \count($aResult) ? \implode('; ', $aResult) : '';
|
||||
}
|
||||
|
||||
private function reParseParameters() : void
|
||||
|
|
@ -93,7 +93,7 @@ class ParameterCollection extends \MailSo\Base\Collection
|
|||
$sParamName = $oParam->Name();
|
||||
|
||||
if (\preg_match('/([^\*]+)\*([\d]{1,2})\*/', $sParamName, $aMatch) && isset($aMatch[1], $aMatch[2])
|
||||
&& 0 < \strlen($aMatch[1]) && \is_numeric($aMatch[2]))
|
||||
&& \strlen($aMatch[1]) && \is_numeric($aMatch[2]))
|
||||
{
|
||||
if (!isset($aPreParams[$aMatch[1]]))
|
||||
{
|
||||
|
|
@ -105,7 +105,7 @@ class ParameterCollection extends \MailSo\Base\Collection
|
|||
if (false !== \strpos($sValue, "''"))
|
||||
{
|
||||
$aValueParts = \explode("''", $sValue, 2);
|
||||
if (\is_array($aValueParts) && 2 === \count($aValueParts) && 0 < \strlen($aValueParts[1]))
|
||||
if (\is_array($aValueParts) && 2 === \count($aValueParts) && \strlen($aValueParts[1]))
|
||||
{
|
||||
$sCharset = $aValueParts[0];
|
||||
$sValue = $aValueParts[1];
|
||||
|
|
@ -125,7 +125,7 @@ class ParameterCollection extends \MailSo\Base\Collection
|
|||
if (false !== \strpos($sValue, "''"))
|
||||
{
|
||||
$aValueParts = \explode("''", $sValue, 2);
|
||||
if (\is_array($aValueParts) && 2 === \count($aValueParts) && 0 < \strlen($aValueParts[1]))
|
||||
if (\is_array($aValueParts) && 2 === \count($aValueParts) && \strlen($aValueParts[1]))
|
||||
{
|
||||
$sCharset = $aValueParts[0];
|
||||
$sValue = $aValueParts[1];
|
||||
|
|
@ -146,7 +146,7 @@ class ParameterCollection extends \MailSo\Base\Collection
|
|||
$sResult = \implode(\array_values($aValues));
|
||||
$sResult = \urldecode($sResult);
|
||||
|
||||
if (0 < \strlen($sCharset))
|
||||
if (\strlen($sCharset))
|
||||
{
|
||||
$sResult = \MailSo\Base\Utils::ConvertEncoding($sResult,
|
||||
$sCharset, \MailSo\Base\Enumerations\Charset::UTF_8);
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class Part
|
|||
|
||||
public function ParentCharset() : string
|
||||
{
|
||||
return (0 < \strlen($this->sCharset)) ? $this->sParentCharset : self::$DefaultCharset;
|
||||
return (\strlen($this->sCharset)) ? $this->sParentCharset : self::$DefaultCharset;
|
||||
}
|
||||
|
||||
public function SetParentCharset(string $sParentCharset) : self
|
||||
|
|
@ -122,14 +122,14 @@ class Part
|
|||
|
||||
public function HeaderCharset() : string
|
||||
{
|
||||
return ($this->Headers) ? trim(strtolower($this->Headers->ParameterValue(
|
||||
return ($this->Headers) ? \trim(\strtolower($this->Headers->ParameterValue(
|
||||
Enumerations\Header::CONTENT_TYPE,
|
||||
Enumerations\Parameter::CHARSET))) : '';
|
||||
}
|
||||
|
||||
public function HeaderBoundary() : string
|
||||
{
|
||||
return ($this->Headers) ? trim($this->Headers->ParameterValue(
|
||||
return ($this->Headers) ? \trim($this->Headers->ParameterValue(
|
||||
Enumerations\Header::CONTENT_TYPE,
|
||||
Enumerations\Parameter::BOUNDARY)) : '';
|
||||
}
|
||||
|
|
@ -137,26 +137,26 @@ class Part
|
|||
public function ContentType() : string
|
||||
{
|
||||
return ($this->Headers) ?
|
||||
trim(strtolower($this->Headers->ValueByName(
|
||||
\trim(\strtolower($this->Headers->ValueByName(
|
||||
Enumerations\Header::CONTENT_TYPE))) : '';
|
||||
}
|
||||
|
||||
public function ContentTransferEncoding() : string
|
||||
{
|
||||
return ($this->Headers) ?
|
||||
trim(strtolower($this->Headers->ValueByName(
|
||||
\trim(\strtolower($this->Headers->ValueByName(
|
||||
Enumerations\Header::CONTENT_TRANSFER_ENCODING))) : '';
|
||||
}
|
||||
|
||||
public function ContentID() : string
|
||||
{
|
||||
return ($this->Headers) ? trim($this->Headers->ValueByName(
|
||||
return ($this->Headers) ? \trim($this->Headers->ValueByName(
|
||||
Enumerations\Header::CONTENT_ID)) : '';
|
||||
}
|
||||
|
||||
public function ContentLocation() : string
|
||||
{
|
||||
return ($this->Headers) ? trim($this->Headers->ValueByName(
|
||||
return ($this->Headers) ? \trim($this->Headers->ValueByName(
|
||||
Enumerations\Header::CONTENT_LOCATION)) : '';
|
||||
}
|
||||
|
||||
|
|
@ -183,13 +183,13 @@ class Part
|
|||
$sResult = '';
|
||||
if ($this->Headers)
|
||||
{
|
||||
$sResult = trim($this->Headers->ParameterValue(
|
||||
$sResult = \trim($this->Headers->ParameterValue(
|
||||
Enumerations\Header::CONTENT_DISPOSITION,
|
||||
Enumerations\Parameter::FILENAME));
|
||||
|
||||
if (0 === strlen($sResult))
|
||||
if (!\strlen($sResult))
|
||||
{
|
||||
$sResult = trim($this->Headers->ParameterValue(
|
||||
$sResult = \trim($this->Headers->ParameterValue(
|
||||
Enumerations\Header::CONTENT_TYPE,
|
||||
Enumerations\Parameter::NAME));
|
||||
}
|
||||
|
|
@ -200,14 +200,14 @@ class Part
|
|||
|
||||
public function ParseFromFile(string $sFileName) : self
|
||||
{
|
||||
$rStreamHandle = (file_exists($sFileName)) ? fopen($sFileName, 'rb') : false;
|
||||
if (is_resource($rStreamHandle))
|
||||
$rStreamHandle = \file_exists($sFileName) ? \fopen($sFileName, 'rb') : false;
|
||||
if (\is_resource($rStreamHandle))
|
||||
{
|
||||
$this->ParseFromStream($rStreamHandle);
|
||||
|
||||
if (is_resource($rStreamHandle))
|
||||
if (\is_resource($rStreamHandle))
|
||||
{
|
||||
fclose($rStreamHandle);
|
||||
\fclose($rStreamHandle);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -216,14 +216,14 @@ class Part
|
|||
|
||||
public function ParseFromString(string $sRawMessage) : self
|
||||
{
|
||||
$rStreamHandle = (0 < strlen($sRawMessage)) ?
|
||||
$rStreamHandle = \strlen($sRawMessage) ?
|
||||
\MailSo\Base\ResourceRegistry::CreateMemoryResource() : false;
|
||||
|
||||
if (is_resource($rStreamHandle))
|
||||
if (\is_resource($rStreamHandle))
|
||||
{
|
||||
fwrite($rStreamHandle, $sRawMessage);
|
||||
\fwrite($rStreamHandle, $sRawMessage);
|
||||
unset($sRawMessage);
|
||||
fseek($rStreamHandle, 0);
|
||||
\fseek($rStreamHandle, 0);
|
||||
|
||||
$this->ParseFromStream($rStreamHandle);
|
||||
|
||||
|
|
@ -260,7 +260,7 @@ class Part
|
|||
foreach ($this->LineParts as /* @var $oMimePart Part */ $oMimePart)
|
||||
{
|
||||
$sCharset = $oMimePart->HeaderCharset();
|
||||
if (0 < strlen($sCharset))
|
||||
if (\strlen($sCharset))
|
||||
{
|
||||
$sFirstNotNullCharset = $sCharset;
|
||||
break;
|
||||
|
|
@ -268,7 +268,7 @@ class Part
|
|||
}
|
||||
|
||||
$sForceCharset = self::$ForceCharset;
|
||||
if (0 < strlen($sForceCharset))
|
||||
if (\strlen($sForceCharset))
|
||||
{
|
||||
foreach ($this->LineParts as /* @var $oMimePart Part */ $oMimePart)
|
||||
{
|
||||
|
|
@ -284,7 +284,7 @@ class Part
|
|||
foreach ($this->LineParts as /* @var $oMimePart Part */ $oMimePart)
|
||||
{
|
||||
$sHeaderCharset = $oMimePart->HeaderCharset();
|
||||
$oMimePart->SetParentCharset((0 < strlen($sHeaderCharset)) ? $sHeaderCharset : $sFirstNotNullCharset);
|
||||
$oMimePart->SetParentCharset((\strlen($sHeaderCharset)) ? $sHeaderCharset : $sFirstNotNullCharset);
|
||||
$oMimePart->Headers->SetParentCharset($sHeaderCharset);
|
||||
}
|
||||
}
|
||||
|
|
@ -315,11 +315,11 @@ class Part
|
|||
$sBuffer = '';
|
||||
}
|
||||
|
||||
if (!$bIsOef && !feof($rStreamHandle))
|
||||
if (!$bIsOef && !\feof($rStreamHandle))
|
||||
{
|
||||
if (!$bNotFirstRead)
|
||||
{
|
||||
$sBuffer = fread($rStreamHandle, $this->iParseBuffer);
|
||||
$sBuffer = \fread($rStreamHandle, $this->iParseBuffer);
|
||||
if (false === $sBuffer)
|
||||
{
|
||||
break;
|
||||
|
|
@ -332,7 +332,7 @@ class Part
|
|||
$bNotFirstRead = false;
|
||||
}
|
||||
}
|
||||
else if ($bIsOef && 0 === strlen($sBuffer))
|
||||
else if ($bIsOef && !\strlen($sBuffer))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
|
@ -347,28 +347,28 @@ class Part
|
|||
if (self::POS_HEADERS === $iParsePosition)
|
||||
{
|
||||
$iEndLen = 4;
|
||||
$iPos = strpos($sCurrentLine, "\r\n\r\n", $iOffset);
|
||||
$iPos = \strpos($sCurrentLine, "\r\n\r\n", $iOffset);
|
||||
if (false === $iPos)
|
||||
{
|
||||
$iEndLen = 2;
|
||||
$iPos = strpos($sCurrentLine, "\n\n", $iOffset);
|
||||
$iPos = \strpos($sCurrentLine, "\n\n", $iOffset);
|
||||
}
|
||||
|
||||
if (false !== $iPos)
|
||||
{
|
||||
$aHeadersLines[] = substr($sCurrentLine, $iOffset, $iPos + $iEndLen - $iOffset);
|
||||
$aHeadersLines[] = \substr($sCurrentLine, $iOffset, $iPos + $iEndLen - $iOffset);
|
||||
|
||||
$this->Headers->Parse(implode($aHeadersLines))->SetParentCharset($this->HeaderCharset());
|
||||
$this->Headers->Parse(\implode($aHeadersLines))->SetParentCharset($this->HeaderCharset());
|
||||
$aHeadersLines = array();
|
||||
|
||||
$oCallbackClass->InitMimePartHeader();
|
||||
|
||||
$sBoundary = $this->HeaderBoundary();
|
||||
if (0 < strlen($sBoundary))
|
||||
if (\strlen($sBoundary))
|
||||
{
|
||||
$sBoundary = '--'.$sBoundary;
|
||||
$sCurrentBoundary = $sBoundary;
|
||||
array_unshift($aBoundaryStack, $sBoundary);
|
||||
\array_unshift($aBoundaryStack, $sBoundary);
|
||||
}
|
||||
|
||||
$iOffset = $iPos + $iEndLen;
|
||||
|
|
@ -377,10 +377,10 @@ class Part
|
|||
}
|
||||
else
|
||||
{
|
||||
$iBufferLen = strlen($sPrevBuffer);
|
||||
$iBufferLen = \strlen($sPrevBuffer);
|
||||
if ($iBufferLen > $iOffset)
|
||||
{
|
||||
$aHeadersLines[] = substr($sPrevBuffer, $iOffset);
|
||||
$aHeadersLines[] = \substr($sPrevBuffer, $iOffset);
|
||||
$iOffset = 0;
|
||||
}
|
||||
else
|
||||
|
|
@ -396,19 +396,19 @@ class Part
|
|||
$sBoundaryLen = 0;
|
||||
$bIsBoundaryEnd = false;
|
||||
$bCurrentPartBody = false;
|
||||
$bIsBoundaryCheck = 0 < count($aBoundaryStack);
|
||||
$bIsBoundaryCheck = \count($aBoundaryStack);
|
||||
|
||||
foreach ($aBoundaryStack as $sKey => $sBoundary)
|
||||
{
|
||||
if (false !== ($iPos = strpos($sCurrentLine, $sBoundary, $iOffset)))
|
||||
if (false !== ($iPos = \strpos($sCurrentLine, $sBoundary, $iOffset)))
|
||||
{
|
||||
if ($sCurrentBoundary === $sBoundary)
|
||||
{
|
||||
$bCurrentPartBody = true;
|
||||
}
|
||||
|
||||
$sBoundaryLen = strlen($sBoundary);
|
||||
if ('--' === substr($sCurrentLine, $iPos + $sBoundaryLen, 2))
|
||||
$sBoundaryLen = \strlen($sBoundary);
|
||||
if ('--' === \substr($sCurrentLine, $iPos + $sBoundaryLen, 2))
|
||||
{
|
||||
$sBoundaryLen += 2;
|
||||
$bIsBoundaryEnd = true;
|
||||
|
|
@ -423,7 +423,7 @@ class Part
|
|||
|
||||
if (false !== $iPos)
|
||||
{
|
||||
$oCallbackClass->WriteBody(substr($sCurrentLine, $iOffset, $iPos - $iOffset));
|
||||
$oCallbackClass->WriteBody(\substr($sCurrentLine, $iOffset, $iPos - $iOffset));
|
||||
$iOffset = $iPos;
|
||||
|
||||
if ($bCurrentPartBody)
|
||||
|
|
@ -437,10 +437,10 @@ class Part
|
|||
}
|
||||
else
|
||||
{
|
||||
$iBufferLen = strlen($sPrevBuffer);
|
||||
$iBufferLen = \strlen($sPrevBuffer);
|
||||
if ($iBufferLen > $iOffset)
|
||||
{
|
||||
$oCallbackClass->WriteBody(substr($sPrevBuffer, $iOffset));
|
||||
$oCallbackClass->WriteBody(\substr($sPrevBuffer, $iOffset));
|
||||
$iOffset = 0;
|
||||
}
|
||||
else
|
||||
|
|
@ -453,24 +453,24 @@ class Part
|
|||
else if (self::POS_SUBPARTS === $iParsePosition)
|
||||
{
|
||||
$iPos = false;
|
||||
$sBoundaryLen = 0;
|
||||
$iBoundaryLen = 0;
|
||||
$bIsBoundaryEnd = false;
|
||||
$bCurrentPartBody = false;
|
||||
$bIsBoundaryCheck = 0 < count($aBoundaryStack);
|
||||
$bIsBoundaryCheck = \count($aBoundaryStack);
|
||||
|
||||
foreach ($aBoundaryStack as $sKey => $sBoundary)
|
||||
{
|
||||
if (false !== ($iPos = strpos($sCurrentLine, $sBoundary, $iOffset)))
|
||||
if (false !== ($iPos = \strpos($sCurrentLine, $sBoundary, $iOffset)))
|
||||
{
|
||||
if ($sCurrentBoundary === $sBoundary)
|
||||
{
|
||||
$bCurrentPartBody = true;
|
||||
}
|
||||
|
||||
$sBoundaryLen = strlen($sBoundary);
|
||||
if ('--' === substr($sCurrentLine, $iPos + $sBoundaryLen, 2))
|
||||
$iBoundaryLen = \strlen($sBoundary);
|
||||
if ('--' === \substr($sCurrentLine, $iPos + $iBoundaryLen, 2))
|
||||
{
|
||||
$sBoundaryLen += 2;
|
||||
$iBoundaryLen += 2;
|
||||
$bIsBoundaryEnd = true;
|
||||
unset($aBoundaryStack[$sKey]);
|
||||
$sCurrentBoundary = (isset($aBoundaryStack[$sKey + 1]))
|
||||
|
|
@ -482,7 +482,7 @@ class Part
|
|||
|
||||
if (false !== $iPos && $bCurrentPartBody)
|
||||
{
|
||||
$iOffset = $iPos + $sBoundaryLen;
|
||||
$iOffset = $iPos + $iBoundaryLen;
|
||||
|
||||
$oSubPart = new self;
|
||||
|
||||
|
|
@ -505,15 +505,15 @@ class Part
|
|||
}
|
||||
}
|
||||
|
||||
if (0 < strlen($sPrevBuffer))
|
||||
if (\strlen($sPrevBuffer))
|
||||
{
|
||||
if (self::POS_HEADERS === $iParsePosition)
|
||||
{
|
||||
$aHeadersLines[] = ($iOffset < strlen($sPrevBuffer))
|
||||
? substr($sPrevBuffer, $iOffset)
|
||||
$aHeadersLines[] = ($iOffset < \strlen($sPrevBuffer))
|
||||
? \substr($sPrevBuffer, $iOffset)
|
||||
: $sPrevBuffer;
|
||||
|
||||
$this->Headers->Parse(implode($aHeadersLines))->SetParentCharset($this->HeaderCharset());
|
||||
$this->Headers->Parse(\implode($aHeadersLines))->SetParentCharset($this->HeaderCharset());
|
||||
$aHeadersLines = array();
|
||||
|
||||
$oCallbackClass->InitMimePartHeader();
|
||||
|
|
@ -522,16 +522,16 @@ class Part
|
|||
{
|
||||
if (!$bIsBoundaryCheck)
|
||||
{
|
||||
$oCallbackClass->WriteBody(($iOffset < strlen($sPrevBuffer))
|
||||
? substr($sPrevBuffer, $iOffset) : $sPrevBuffer);
|
||||
$oCallbackClass->WriteBody(($iOffset < \strlen($sPrevBuffer))
|
||||
? \substr($sPrevBuffer, $iOffset) : $sPrevBuffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (self::POS_HEADERS === $iParsePosition && 0 < count($aHeadersLines))
|
||||
if (self::POS_HEADERS === $iParsePosition && \count($aHeadersLines))
|
||||
{
|
||||
$this->Headers->Parse(implode($aHeadersLines))->SetParentCharset($this->HeaderCharset());
|
||||
$this->Headers->Parse(\implode($aHeadersLines))->SetParentCharset($this->HeaderCharset());
|
||||
$aHeadersLines = array();
|
||||
|
||||
$oCallbackClass->InitMimePartHeader();
|
||||
|
|
@ -579,12 +579,12 @@ class Part
|
|||
if (0 < $this->SubParts->Count())
|
||||
{
|
||||
$sBoundary = $this->HeaderBoundary();
|
||||
if (0 < strlen($sBoundary))
|
||||
if (\strlen($sBoundary))
|
||||
{
|
||||
$aSubStreams[] = '--'.$sBoundary.Enumerations\Constants::CRLF;
|
||||
|
||||
$rSubPartsStream = $this->SubParts->ToStream($sBoundary);
|
||||
if (is_resource($rSubPartsStream))
|
||||
if (\is_resource($rSubPartsStream))
|
||||
{
|
||||
$aSubStreams[] = $rSubPartsStream;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,13 +28,13 @@ class PartCollection extends \MailSo\Base\Collection
|
|||
*/
|
||||
public function ToStream(string $sBoundary)
|
||||
{
|
||||
if (0 < \strlen($sBoundary))
|
||||
if (\strlen($sBoundary))
|
||||
{
|
||||
$aResult = array();
|
||||
|
||||
foreach ($this as $oPart)
|
||||
{
|
||||
if (0 < count($aResult))
|
||||
if (\count($aResult))
|
||||
{
|
||||
$aResult[] = Enumerations\Constants::CRLF.
|
||||
'--'.$sBoundary.Enumerations\Constants::CRLF;
|
||||
|
|
|
|||
|
|
@ -326,7 +326,7 @@ abstract class NetClient
|
|||
\MailSo\Log\Enumerations\Type::ERROR, true);
|
||||
}
|
||||
|
||||
$bFake = 0 < \strlen($sFakeRaw);
|
||||
$bFake = \strlen($sFakeRaw);
|
||||
$sRaw .= "\r\n";
|
||||
|
||||
if ($this->oLogger && $this->oLogger->IsShowSecter())
|
||||
|
|
|
|||
|
|
@ -223,7 +223,7 @@ class SmtpClient extends \MailSo\Net\NetClient
|
|||
|
||||
$sCmd = 'FROM:<'.$sFrom.'>';
|
||||
|
||||
if (0 < \strlen($sSizeIfSupported) && \is_numeric($sSizeIfSupported) && $this->IsSupported('SIZE'))
|
||||
if (\strlen($sSizeIfSupported) && \is_numeric($sSizeIfSupported) && $this->IsSupported('SIZE'))
|
||||
{
|
||||
$sCmd .= ' SIZE='.$sSizeIfSupported;
|
||||
}
|
||||
|
|
@ -515,7 +515,7 @@ class SmtpClient extends \MailSo\Net\NetClient
|
|||
foreach ($this->aResults as $sLine)
|
||||
{
|
||||
$aMatch = array();
|
||||
if (\preg_match('/[\d]+[ \-](.+)$/', $sLine, $aMatch) && isset($aMatch[1]) && 0 < \strlen($aMatch[1]))
|
||||
if (\preg_match('/[\d]+[ \-](.+)$/', $sLine, $aMatch) && isset($aMatch[1]) && \strlen($aMatch[1]))
|
||||
{
|
||||
$sLine = \trim($aMatch[1]);
|
||||
$aLine = \preg_split('/[ =]/', $sLine, 2);
|
||||
|
|
@ -525,7 +525,7 @@ class SmtpClient extends \MailSo\Net\NetClient
|
|||
if (('AUTH' === $sCapa || 'SIZE' === $sCapa) && !empty($aLine[1]))
|
||||
{
|
||||
$sSubLine = \trim(\strtoupper($aLine[1]));
|
||||
if (0 < \strlen($sSubLine))
|
||||
if (\strlen($sSubLine))
|
||||
{
|
||||
if ('AUTH' === $sCapa)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -498,7 +498,7 @@ trait Admin
|
|||
if ($sRep)
|
||||
{
|
||||
$aRep = \json_decode($sRep);
|
||||
$bReal = \is_array($aRep) && 0 < \count($aRep);
|
||||
$bReal = \is_array($aRep) && \count($aRep);
|
||||
|
||||
if ($bReal)
|
||||
{
|
||||
|
|
@ -514,7 +514,7 @@ trait Admin
|
|||
else if ('' !== $sRep)
|
||||
{
|
||||
$aRep = \json_decode($sRep, false, 10);
|
||||
$bReal = \is_array($aRep) && 0 < \count($aRep);
|
||||
$bReal = \is_array($aRep) && \count($aRep);
|
||||
}
|
||||
|
||||
return \is_array($aRep) ? $aRep : [];
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ trait Contacts
|
|||
$aFilteredUids = \array_filter(\array_map('intval', $aUids));
|
||||
|
||||
$bResult = false;
|
||||
if (0 < \count($aFilteredUids) && $this->AddressBookProvider($oAccount)->IsActive())
|
||||
if (\count($aFilteredUids) && $this->AddressBookProvider($oAccount)->IsActive())
|
||||
{
|
||||
$bResult = $this->AddressBookProvider($oAccount)->DeleteContacts($this->GetMainEmail($oAccount), $aFilteredUids);
|
||||
}
|
||||
|
|
@ -117,12 +117,12 @@ trait Contacts
|
|||
|
||||
$oAddressBookProvider = $this->AddressBookProvider($oAccount);
|
||||
$sRequestUid = \trim($this->GetActionParam('RequestUid', ''));
|
||||
if ($oAddressBookProvider && $oAddressBookProvider->IsActive() && 0 < \strlen($sRequestUid))
|
||||
if ($oAddressBookProvider && $oAddressBookProvider->IsActive() && \strlen($sRequestUid))
|
||||
{
|
||||
$sUid = \trim($this->GetActionParam('Uid', ''));
|
||||
|
||||
$oContact = null;
|
||||
if (0 < \strlen($sUid))
|
||||
if (\strlen($sUid))
|
||||
{
|
||||
$oContact = $oAddressBookProvider->GetContactByID($this->GetMainEmail($oAccount), $sUid);
|
||||
}
|
||||
|
|
@ -130,7 +130,7 @@ trait Contacts
|
|||
if (!$oContact)
|
||||
{
|
||||
$oContact = new \RainLoop\Providers\AddressBook\Classes\Contact();
|
||||
if (0 < \strlen($sUid))
|
||||
if (\strlen($sUid))
|
||||
{
|
||||
$oContact->IdContact = $sUid;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,21 +114,21 @@ trait Folders
|
|||
{
|
||||
$mNewParent = \substr($mFolderNameToCreate, 0, $iPos);
|
||||
$mNewFolderNameToCreate = \substr($mFolderNameToCreate, $iPos + 1);
|
||||
if (0 < \strlen($mNewFolderNameToCreate))
|
||||
if (\strlen($mNewFolderNameToCreate))
|
||||
{
|
||||
$mFolderNameToCreate = $mNewFolderNameToCreate;
|
||||
}
|
||||
|
||||
if (0 < \strlen($mNewParent))
|
||||
if (\strlen($mNewParent))
|
||||
{
|
||||
$sParent = 0 < \strlen($sParent) ? $sParent.$sDelimiter.$mNewParent : $mNewParent;
|
||||
$sParent = \strlen($sParent) ? $sParent.$sDelimiter.$mNewParent : $mNewParent;
|
||||
}
|
||||
}
|
||||
|
||||
$sFullNameToCheck = \MailSo\Base\Utils::ConvertEncoding($mFolderNameToCreate,
|
||||
\MailSo\Base\Enumerations\Charset::UTF_8, \MailSo\Base\Enumerations\Charset::UTF_7_IMAP);
|
||||
|
||||
if (0 < \strlen(\trim($sParent)))
|
||||
if (\strlen(\trim($sParent)))
|
||||
{
|
||||
$sFullNameToCheck = $sParent.$sDelimiter.$sFullNameToCheck;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -301,7 +301,7 @@ trait Messages
|
|||
}
|
||||
}
|
||||
|
||||
if (0 < \count($aArrayToFrec))
|
||||
if (\count($aArrayToFrec))
|
||||
{
|
||||
$oSettings = $this->SettingsProvider()->Load($oAccount);
|
||||
|
||||
|
|
@ -616,7 +616,7 @@ trait Messages
|
|||
try
|
||||
{
|
||||
$aAttachments = $this->GetActionParam('Attachments', array());
|
||||
if (\is_array($aAttachments) && 0 < \count($aAttachments))
|
||||
if (\is_array($aAttachments) && \count($aAttachments))
|
||||
{
|
||||
$mResult = array();
|
||||
foreach ($aAttachments as $sAttachment)
|
||||
|
|
@ -758,7 +758,7 @@ trait Messages
|
|||
$oSmtpClient->Rcpt($oEmail->GetEmail(), $bDsn);
|
||||
}
|
||||
|
||||
if ($bAddHiddenRcpt && \is_array($aHiddenRcpt) && 0 < \count($aHiddenRcpt))
|
||||
if ($bAddHiddenRcpt && \is_array($aHiddenRcpt) && \count($aHiddenRcpt))
|
||||
{
|
||||
foreach ($aHiddenRcpt as $sEmail)
|
||||
{
|
||||
|
|
@ -1058,7 +1058,7 @@ trait Messages
|
|||
}
|
||||
}
|
||||
|
||||
if ($mFoundDataURL && \is_array($mFoundDataURL) && 0 < \count($mFoundDataURL))
|
||||
if ($mFoundDataURL && \is_array($mFoundDataURL) && \count($mFoundDataURL))
|
||||
{
|
||||
foreach ($mFoundDataURL as $sCidHash => $sDataUrlString)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -278,7 +278,7 @@ trait Raw
|
|||
|
||||
if ($sLoadedData)
|
||||
{
|
||||
if ($bIsRangeRequest && (0 < \strlen($sRangeStart) || 0 < \strlen($sRangeEnd)))
|
||||
if ($bIsRangeRequest && (\strlen($sRangeStart) || \strlen($sRangeEnd)))
|
||||
{
|
||||
$iFullContentLength = \strlen($sLoadedData);
|
||||
|
||||
|
|
|
|||
|
|
@ -267,7 +267,7 @@ trait Response
|
|||
if ($oAttachment)
|
||||
{
|
||||
$sContentLocation = $oAttachment->ContentLocation();
|
||||
if ($sContentLocation && 0 < \strlen($sContentLocation))
|
||||
if ($sContentLocation && \strlen($sContentLocation))
|
||||
{
|
||||
$aContentLocationUrls[] = $oAttachment->ContentLocation();
|
||||
}
|
||||
|
|
@ -324,8 +324,8 @@ trait Response
|
|||
unset($sHtml, $sPlain);
|
||||
|
||||
$mResult['HasExternals'] = $bHasExternals;
|
||||
$mResult['HasInternals'] = (\is_array($mFoundedCIDs) && 0 < \count($mFoundedCIDs)) ||
|
||||
(\is_array($mFoundedContentLocationUrls) && 0 < \count($mFoundedContentLocationUrls));
|
||||
$mResult['HasInternals'] = (\is_array($mFoundedCIDs) && \count($mFoundedCIDs)) ||
|
||||
(\is_array($mFoundedContentLocationUrls) && \count($mFoundedContentLocationUrls));
|
||||
$mResult['FoundedCIDs'] = $mFoundedCIDs;
|
||||
$mResult['Attachments'] = $this->responseObject($oAttachments, $sParent, \array_merge($aParameters, array(
|
||||
'FoundedCIDs' => $mFoundedCIDs,
|
||||
|
|
@ -333,9 +333,9 @@ trait Response
|
|||
)));
|
||||
|
||||
$mResult['ReadReceipt'] = $mResponse->ReadReceipt();
|
||||
if (0 < \strlen($mResult['ReadReceipt']) && !$mResult['IsReadReceipt'])
|
||||
if (\strlen($mResult['ReadReceipt']) && !$mResult['IsReadReceipt'])
|
||||
{
|
||||
if (0 < \strlen($mResult['ReadReceipt']))
|
||||
if (\strlen($mResult['ReadReceipt']))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
@ -348,7 +348,7 @@ trait Response
|
|||
catch (\Throwable $oException) { unset($oException); }
|
||||
}
|
||||
|
||||
if (0 < \strlen($mResult['ReadReceipt']) && '1' === $this->Cacher($oAccount)->Get(
|
||||
if (\strlen($mResult['ReadReceipt']) && '1' === $this->Cacher($oAccount)->Get(
|
||||
\RainLoop\KeyPathHelper::ReadReceiptCache($oAccount->Email(), $mResult['Folder'], $mResult['Uid']), '0'))
|
||||
{
|
||||
$mResult['ReadReceipt'] = '';
|
||||
|
|
@ -367,12 +367,12 @@ trait Response
|
|||
}
|
||||
|
||||
$mFoundedCIDs = isset($aParameters['FoundedCIDs']) && \is_array($aParameters['FoundedCIDs']) &&
|
||||
0 < \count($aParameters['FoundedCIDs']) ?
|
||||
\count($aParameters['FoundedCIDs']) ?
|
||||
$aParameters['FoundedCIDs'] : null;
|
||||
|
||||
$mFoundedContentLocationUrls = isset($aParameters['FoundedContentLocationUrls']) &&
|
||||
\is_array($aParameters['FoundedContentLocationUrls']) &&
|
||||
0 < \count($aParameters['FoundedContentLocationUrls']) ?
|
||||
\count($aParameters['FoundedContentLocationUrls']) ?
|
||||
$aParameters['FoundedContentLocationUrls'] : null;
|
||||
|
||||
if ($mFoundedCIDs || $mFoundedContentLocationUrls)
|
||||
|
|
@ -380,7 +380,7 @@ trait Response
|
|||
$mFoundedCIDs = \array_merge($mFoundedCIDs ? $mFoundedCIDs : array(),
|
||||
$mFoundedContentLocationUrls ? $mFoundedContentLocationUrls : array());
|
||||
|
||||
$mFoundedCIDs = 0 < \count($mFoundedCIDs) ? $mFoundedCIDs : null;
|
||||
$mFoundedCIDs = \count($mFoundedCIDs) ? $mFoundedCIDs : null;
|
||||
}
|
||||
|
||||
$mResult['IsLinked'] = ($mFoundedCIDs && \in_array(\trim(\trim($mResponse->Cid()), '<>'), $mFoundedCIDs))
|
||||
|
|
|
|||
|
|
@ -419,7 +419,7 @@ rl_email text NOT NULL DEFAULT \'\'
|
|||
break;
|
||||
}
|
||||
|
||||
if (0 < \count($aQ))
|
||||
if (\count($aQ))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ abstract class AbstractConfig
|
|||
|
||||
$sAdditionalFileName = \trim($sAdditionalFileName);
|
||||
$this->sAdditionalFile = \APP_PRIVATE_DATA.'configs/'.$sAdditionalFileName;
|
||||
$this->sAdditionalFile = 0 < \strlen($sAdditionalFileName) &&
|
||||
$this->sAdditionalFile = \strlen($sAdditionalFileName) &&
|
||||
\file_exists($this->sAdditionalFile) ? $this->sAdditionalFile : '';
|
||||
|
||||
$this->sFileHeader = $sFileHeader;
|
||||
|
|
@ -49,7 +49,7 @@ abstract class AbstractConfig
|
|||
|
||||
public function IsInited() : bool
|
||||
{
|
||||
return \is_array($this->aData) && 0 < \count($this->aData);
|
||||
return \is_array($this->aData) && \count($this->aData);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -186,7 +186,7 @@ abstract class AbstractConfig
|
|||
}
|
||||
|
||||
$aData = \RainLoop\Utils::CustomParseIniFile($this->sFile, true);
|
||||
if (0 < \count($aData))
|
||||
if (\count($aData))
|
||||
{
|
||||
foreach ($aData as $sSectionKey => $aSectionValue)
|
||||
{
|
||||
|
|
@ -204,7 +204,7 @@ abstract class AbstractConfig
|
|||
if (\file_exists($this->sAdditionalFile) && \is_readable($this->sAdditionalFile))
|
||||
{
|
||||
$aSubData = \RainLoop\Utils::CustomParseIniFile($this->sAdditionalFile, true);
|
||||
if (\is_array($aSubData) && 0 < \count($aSubData))
|
||||
if (\is_array($aSubData) && \count($aSubData))
|
||||
{
|
||||
foreach ($aSubData as $sSectionKey => $aSectionValue)
|
||||
{
|
||||
|
|
@ -295,7 +295,7 @@ abstract class AbstractConfig
|
|||
|
||||
$this->clearCache();
|
||||
return false !== \file_put_contents($this->sFile,
|
||||
(0 < \strlen($this->sFileHeader) ? $this->sFileHeader : '').
|
||||
(\strlen($this->sFileHeader) ? $this->sFileHeader : '').
|
||||
$sNewLine.\implode($sNewLine, $aResultLines));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,11 +19,11 @@ class Application extends \RainLoop\Config\AbstractConfig
|
|||
$bResult = parent::Load();
|
||||
|
||||
$this->aReplaceEnv = null;
|
||||
if ((isset($_ENV) && \is_array($_ENV) && 0 < \count($_ENV)) ||
|
||||
(isset($_SERVER) && \is_array($_SERVER) && 0 < \count($_SERVER)))
|
||||
if ((isset($_ENV) && \is_array($_ENV) && \count($_ENV)) ||
|
||||
(isset($_SERVER) && \is_array($_SERVER) && \count($_SERVER)))
|
||||
{
|
||||
$sEnvNames = $this->Get('labs', 'replace_env_in_configuration', '');
|
||||
if (0 < \strlen($sEnvNames))
|
||||
if (\strlen($sEnvNames))
|
||||
{
|
||||
$this->aReplaceEnv = \explode(',', $sEnvNames);
|
||||
if (\is_array($this->aReplaceEnv))
|
||||
|
|
@ -93,7 +93,7 @@ class Application extends \RainLoop\Config\AbstractConfig
|
|||
$this->SetPassword($sPassword);
|
||||
return true;
|
||||
}
|
||||
return 0 < \strlen($sPassword) && \password_verify($sPassword, $sConfigPassword);
|
||||
return \strlen($sPassword) && \password_verify($sPassword, $sConfigPassword);
|
||||
}
|
||||
|
||||
public function Save() : bool
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ class Plugin extends \RainLoop\Config\AbstractConfig
|
|||
|
||||
private function convertConfigMap(array $aMap) : array
|
||||
{
|
||||
if (0 < \count($aMap))
|
||||
if (\count($aMap))
|
||||
{
|
||||
$aResultMap = array();
|
||||
foreach ($aMap as /* @var $oProperty \RainLoop\Plugins\Property */ $oProperty)
|
||||
|
|
@ -31,7 +31,7 @@ class Plugin extends \RainLoop\Config\AbstractConfig
|
|||
}
|
||||
}
|
||||
|
||||
if (0 < \count($aResultMap))
|
||||
if (\count($aResultMap))
|
||||
{
|
||||
return array(
|
||||
'plugin' => $aResultMap
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ class Domain implements \JsonSerializable
|
|||
{
|
||||
$oDomain = null;
|
||||
|
||||
if (0 < \strlen($sName) && 0 < \strlen($aDomain['imap_host']) && 0 < \strlen($aDomain['imap_port']))
|
||||
if (\strlen($sName) && \strlen($aDomain['imap_host']) && \strlen($aDomain['imap_port']))
|
||||
{
|
||||
$sIncHost = (string) $aDomain['imap_host'];
|
||||
$iIncPort = (int) $aDomain['imap_port'];
|
||||
|
|
@ -381,7 +381,7 @@ class Domain implements \JsonSerializable
|
|||
public function ValidateWhiteList(string $sEmail, string $sLogin = '') : bool
|
||||
{
|
||||
$sW = \trim($this->sWhiteList);
|
||||
if (0 < strlen($sW))
|
||||
if (\strlen($sW))
|
||||
{
|
||||
$sEmail = \MailSo\Base\Utils::IdnToUtf8($sEmail, true);
|
||||
$sLogin = \MailSo\Base\Utils::IdnToUtf8($sLogin, true);
|
||||
|
|
@ -389,7 +389,7 @@ class Domain implements \JsonSerializable
|
|||
$sW = \preg_replace('/([^\s]+)@[^\s]*/', '$1', $sW);
|
||||
$sW = ' '.\trim(\preg_replace('/[\s;,\r\n\t]+/', ' ', $sW)).' ';
|
||||
|
||||
$sUserPart = \MailSo\Base\Utils::GetAccountNameFromEmail(0 < \strlen($sLogin) ? $sLogin : $sEmail);
|
||||
$sUserPart = \MailSo\Base\Utils::GetAccountNameFromEmail(\strlen($sLogin) ? $sLogin : $sEmail);
|
||||
return false !== \stripos($sW, ' '.$sUserPart.' ');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ abstract class AbstractPlugin
|
|||
|
||||
public function SetVersion(string $sVersion) : self
|
||||
{
|
||||
if (0 < \strlen($sVersion))
|
||||
if (\strlen($sVersion))
|
||||
{
|
||||
$this->sVersion = $sVersion;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ class AddressBook extends \RainLoop\Providers\AbstractProvider
|
|||
public function ImportCsvArray(string $sEmail, array $aCsvData) : int
|
||||
{
|
||||
$iCount = 0;
|
||||
if ($this->IsActive() && 0 < \count($aCsvData))
|
||||
if ($this->IsActive() && \count($aCsvData))
|
||||
{
|
||||
$oContact = new \RainLoop\Providers\AddressBook\Classes\Contact();
|
||||
foreach ($aCsvData as $aItem)
|
||||
|
|
@ -202,7 +202,7 @@ class AddressBook extends \RainLoop\Providers\AbstractProvider
|
|||
}
|
||||
}
|
||||
|
||||
if ($oContact && 0 < \count($oContact->Properties))
|
||||
if ($oContact && \count($oContact->Properties))
|
||||
{
|
||||
if ($this->ContactSave($sEmail, $oContact))
|
||||
{
|
||||
|
|
@ -255,7 +255,7 @@ class AddressBook extends \RainLoop\Providers\AbstractProvider
|
|||
|
||||
$oContact->PopulateByVCard($oVCard);
|
||||
|
||||
if (0 < \count($oContact->Properties))
|
||||
if (\count($oContact->Properties))
|
||||
{
|
||||
if ($this->ContactSave($sEmail, $oContact))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ class Contact implements \JsonSerializable
|
|||
$oFullNameProperty =& $oProperty;
|
||||
}
|
||||
|
||||
if (0 < \strlen($oProperty->Value))
|
||||
if (\strlen($oProperty->Value))
|
||||
{
|
||||
if ('' === $sEmail && $oProperty->IsEmail())
|
||||
{
|
||||
|
|
@ -117,7 +117,7 @@ class Contact implements \JsonSerializable
|
|||
|
||||
$sDisplay = $bForceFullNameReplace ? '' : \trim($sFullName);
|
||||
|
||||
if ('' === $sDisplay && (0 < \strlen($sLastName) || 0 < \strlen($sFirstName)))
|
||||
if ('' === $sDisplay && (\strlen($sLastName) || \strlen($sFirstName)))
|
||||
{
|
||||
$sDisplay = \trim($sFirstName.' '.$sLastName);
|
||||
}
|
||||
|
|
@ -190,7 +190,7 @@ class Contact implements \JsonSerializable
|
|||
}
|
||||
|
||||
$oVCard = null;
|
||||
if (0 < \strlen($sPreVCard))
|
||||
if (\strlen($sPreVCard))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
@ -273,7 +273,7 @@ class Contact implements \JsonSerializable
|
|||
}
|
||||
|
||||
$aTypes = $oProperty->TypesAsArray();
|
||||
$oVCard->add($sAddKey, $oProperty->Value, \is_array($aTypes) && 0 < \count($aTypes) ? array('TYPE' => $aTypes) : null);
|
||||
$oVCard->add($sAddKey, $oProperty->Value, \is_array($aTypes) && \count($aTypes) ? array('TYPE' => $aTypes) : null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -450,7 +450,7 @@ class Contact implements \JsonSerializable
|
|||
$sValue = \trim($oProp);
|
||||
if ($bOldVersion && !isset($oProp->parameters['CHARSET']))
|
||||
{
|
||||
if (0 < \strlen($sValue))
|
||||
if (\strlen($sValue))
|
||||
{
|
||||
$sEncValue = \utf8_encode($sValue);
|
||||
if (0 === \strlen($sEncValue))
|
||||
|
|
@ -476,7 +476,7 @@ class Contact implements \JsonSerializable
|
|||
$aTypes = $oTypes ? $oTypes->getParts() : array();
|
||||
$sValue = $oProp ? \trim($oProp->getValue()) : '';
|
||||
|
||||
if (0 < \strlen($sValue))
|
||||
if (\strlen($sValue))
|
||||
{
|
||||
if (!$oTypes || $oTypes->has('PREF'))
|
||||
{
|
||||
|
|
@ -530,7 +530,7 @@ class Contact implements \JsonSerializable
|
|||
$sValue = \trim($sValue);
|
||||
if ($bOldVersion && !isset($oVCard->N->parameters['CHARSET']))
|
||||
{
|
||||
if (0 < \strlen($sValue))
|
||||
if (\strlen($sValue))
|
||||
{
|
||||
$sEncValue = \utf8_encode($sValue);
|
||||
if (0 === \strlen($sEncValue))
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ class Property implements \JsonSerializable
|
|||
$this->TypeStr = \trim($this->TypeStr);
|
||||
$this->ValueLower = '';
|
||||
|
||||
if (0 < \strlen($this->Value))
|
||||
if (\strlen($this->Value))
|
||||
{
|
||||
// lower
|
||||
if ($this->IsEmail())
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class PdoAddressBook
|
|||
if ($oStmt)
|
||||
{
|
||||
$aFetch = $oStmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||
if (\is_array($aFetch) && 0 < \count($aFetch))
|
||||
if (\is_array($aFetch) && \count($aFetch))
|
||||
{
|
||||
foreach ($aFetch as $aItem)
|
||||
{
|
||||
|
|
@ -156,7 +156,7 @@ class PdoAddressBook
|
|||
}
|
||||
}
|
||||
|
||||
if (0 < \count($aIdsForDeletedion))
|
||||
if (\count($aIdsForDeletedion))
|
||||
{
|
||||
$this->DeleteContacts($sEmail, $aIdsForDeletedion, false);
|
||||
}
|
||||
|
|
@ -182,7 +182,7 @@ class PdoAddressBook
|
|||
{
|
||||
$sExsistensBody = '';
|
||||
$mExsistenRemoteID = isset($aRemoteSyncData[$sKey]['vcf']) && !empty($aData['etag']) ? $aRemoteSyncData[$sKey]['vcf'] : '';
|
||||
if (0 < \strlen($mExsistenRemoteID))
|
||||
if (\strlen($mExsistenRemoteID))
|
||||
{
|
||||
$oResponse = $this->davClientRequest($oClient, 'GET', $sPath.$mExsistenRemoteID);
|
||||
if ($oResponse)
|
||||
|
|
@ -194,7 +194,7 @@ class PdoAddressBook
|
|||
}
|
||||
|
||||
$oResponse = $this->davClientRequest($oClient, 'PUT',
|
||||
$sPath.(0 < \strlen($mExsistenRemoteID) ? $mExsistenRemoteID : $oContact->CardDavNameUri()),
|
||||
$sPath.(\strlen($mExsistenRemoteID) ? $mExsistenRemoteID : $oContact->CardDavNameUri()),
|
||||
$oContact->ToVCard($sExsistensBody, $this->oLogger)."\r\n\r\n");
|
||||
if ($oResponse)
|
||||
{
|
||||
|
|
@ -298,7 +298,7 @@ class PdoAddressBook
|
|||
$bCsvHeader = true;
|
||||
|
||||
$aDatabaseSyncData = $this->prepearDatabaseSyncData($iUserID);
|
||||
if (\is_array($aDatabaseSyncData) && 0 < \count($aDatabaseSyncData))
|
||||
if (\is_array($aDatabaseSyncData) && \count($aDatabaseSyncData))
|
||||
{
|
||||
foreach ($aDatabaseSyncData as $mData)
|
||||
{
|
||||
|
|
@ -333,7 +333,7 @@ class PdoAddressBook
|
|||
|
||||
$iUserID = $this->getUserId($sEmail);
|
||||
|
||||
$iIdContact = 0 < \strlen($oContact->IdContact) && \is_numeric($oContact->IdContact) ? (int) $oContact->IdContact : 0;
|
||||
$iIdContact = \strlen($oContact->IdContact) && \is_numeric($oContact->IdContact) ? (int) $oContact->IdContact : 0;
|
||||
|
||||
$bUpdate = 0 < $iIdContact;
|
||||
|
||||
|
|
@ -418,7 +418,7 @@ class PdoAddressBook
|
|||
);
|
||||
}
|
||||
|
||||
if (0 < \count($aParams))
|
||||
if (\count($aParams))
|
||||
{
|
||||
$sSql = 'INSERT INTO rainloop_ab_properties '.
|
||||
'( id_contact, id_user, prop_type, prop_type_str, prop_value, prop_value_lower, prop_value_custom, prop_frec)'.
|
||||
|
|
@ -500,7 +500,7 @@ class PdoAddressBook
|
|||
$aSearchIds = array();
|
||||
$aPropertyFromSearchIds = array();
|
||||
|
||||
if (0 < \strlen($sSearch))
|
||||
if (\strlen($sSearch))
|
||||
{
|
||||
$sCustomSearch = $this->specialConvertSearchValueCustomPhone($sSearch);
|
||||
$sLowerSearch = $this->specialConvertSearchValueLower($sSearch, '=');
|
||||
|
|
@ -513,8 +513,8 @@ class PdoAddressBook
|
|||
$sSql = 'SELECT id_user, id_prop, id_contact FROM rainloop_ab_properties '.
|
||||
'WHERE (id_user = :id_user) AND prop_type IN ('.$sSearchTypes.') AND ('.
|
||||
'prop_value LIKE :search ESCAPE \'=\''.
|
||||
(0 < \strlen($sLowerSearch) ? ' OR (prop_value_lower <> \'\' AND prop_value_lower LIKE :search_lower ESCAPE \'=\')' : '').
|
||||
(0 < \strlen($sCustomSearch) ? ' OR (prop_type = '.PropertyType::PHONE.' AND prop_value_custom <> \'\' AND prop_value_custom LIKE :search_custom_phone)' : '').
|
||||
(\strlen($sLowerSearch) ? ' OR (prop_value_lower <> \'\' AND prop_value_lower LIKE :search_lower ESCAPE \'=\')' : '').
|
||||
(\strlen($sCustomSearch) ? ' OR (prop_type = '.PropertyType::PHONE.' AND prop_value_custom <> \'\' AND prop_value_custom LIKE :search_custom_phone)' : '').
|
||||
') GROUP BY id_contact, id_prop';
|
||||
|
||||
$aParams = array(
|
||||
|
|
@ -522,12 +522,12 @@ class PdoAddressBook
|
|||
':search' => array($this->specialConvertSearchValue($sSearch, '='), \PDO::PARAM_STR)
|
||||
);
|
||||
|
||||
if (0 < \strlen($sLowerSearch))
|
||||
if (\strlen($sLowerSearch))
|
||||
{
|
||||
$aParams[':search_lower'] = array($sLowerSearch, \PDO::PARAM_STR);
|
||||
}
|
||||
|
||||
if (0 < \strlen($sCustomSearch))
|
||||
if (\strlen($sCustomSearch))
|
||||
{
|
||||
$aParams[':search_custom_phone'] = array($sCustomSearch, \PDO::PARAM_STR);
|
||||
}
|
||||
|
|
@ -536,7 +536,7 @@ class PdoAddressBook
|
|||
if ($oStmt)
|
||||
{
|
||||
$aFetch = $oStmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||
if (\is_array($aFetch) && 0 < \count($aFetch))
|
||||
if (\is_array($aFetch) && \count($aFetch))
|
||||
{
|
||||
foreach ($aFetch as $aItem)
|
||||
{
|
||||
|
|
@ -584,7 +584,7 @@ class PdoAddressBook
|
|||
':id_user' => array($iUserID, \PDO::PARAM_INT)
|
||||
);
|
||||
|
||||
if (0 < \count($aSearchIds))
|
||||
if (\count($aSearchIds))
|
||||
{
|
||||
$sSql .= ' AND id_contact IN ('.implode(',', $aSearchIds).')';
|
||||
}
|
||||
|
|
@ -600,7 +600,7 @@ class PdoAddressBook
|
|||
|
||||
$aContacts = array();
|
||||
$aIdContacts = array();
|
||||
if (\is_array($aFetch) && 0 < \count($aFetch))
|
||||
if (\is_array($aFetch) && \count($aFetch))
|
||||
{
|
||||
foreach ($aFetch as $aItem)
|
||||
{
|
||||
|
|
@ -626,7 +626,7 @@ class PdoAddressBook
|
|||
|
||||
unset($aFetch);
|
||||
|
||||
if (0 < count($aIdContacts))
|
||||
if (\count($aIdContacts))
|
||||
{
|
||||
$oStmt->closeCursor();
|
||||
|
||||
|
|
@ -636,7 +636,7 @@ class PdoAddressBook
|
|||
if ($oStmt)
|
||||
{
|
||||
$aFetch = $oStmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||
if (\is_array($aFetch) && 0 < \count($aFetch))
|
||||
if (\is_array($aFetch) && \count($aFetch))
|
||||
{
|
||||
foreach ($aFetch as $aItem)
|
||||
{
|
||||
|
|
@ -712,7 +712,7 @@ class PdoAddressBook
|
|||
{
|
||||
$aFetch = $oStmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||
|
||||
if (\is_array($aFetch) && 0 < \count($aFetch))
|
||||
if (\is_array($aFetch) && \count($aFetch))
|
||||
{
|
||||
foreach ($aFetch as $aItem)
|
||||
{
|
||||
|
|
@ -743,7 +743,7 @@ class PdoAddressBook
|
|||
if ($oStmt)
|
||||
{
|
||||
$aFetch = $oStmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||
if (\is_array($aFetch) && 0 < \count($aFetch))
|
||||
if (\is_array($aFetch) && \count($aFetch))
|
||||
{
|
||||
foreach ($aFetch as $aItem)
|
||||
{
|
||||
|
|
@ -800,7 +800,7 @@ class PdoAddressBook
|
|||
$sSql = 'SELECT id_contact, id_prop, prop_type, prop_value FROM rainloop_ab_properties '.
|
||||
'WHERE (id_user = :id_user) AND prop_type IN ('.$sTypes.') AND ('.
|
||||
'prop_value LIKE :search ESCAPE \'=\''.
|
||||
(0 < \strlen($sLowerSearch) ? ' OR (prop_value_lower <> \'\' AND prop_value_lower LIKE :search_lower ESCAPE \'=\')' : '').
|
||||
(\strlen($sLowerSearch) ? ' OR (prop_value_lower <> \'\' AND prop_value_lower LIKE :search_lower ESCAPE \'=\')' : '').
|
||||
')'
|
||||
;
|
||||
|
||||
|
|
@ -810,7 +810,7 @@ class PdoAddressBook
|
|||
':search' => array($this->specialConvertSearchValue($sSearch, '='), \PDO::PARAM_STR)
|
||||
);
|
||||
|
||||
if (0 < \strlen($sLowerSearch))
|
||||
if (\strlen($sLowerSearch))
|
||||
{
|
||||
$aParams[':search_lower'] = array($sLowerSearch, \PDO::PARAM_STR);
|
||||
}
|
||||
|
|
@ -828,7 +828,7 @@ class PdoAddressBook
|
|||
$aContactAllAccess = array();
|
||||
|
||||
$aFetch = $oStmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||
if (\is_array($aFetch) && 0 < \count($aFetch))
|
||||
if (\is_array($aFetch) && \count($aFetch))
|
||||
{
|
||||
foreach ($aFetch as $aItem)
|
||||
{
|
||||
|
|
@ -857,7 +857,7 @@ class PdoAddressBook
|
|||
unset($aFetch);
|
||||
|
||||
$aIdContacts = \array_values($aIdContacts);
|
||||
if (0 < count($aIdContacts))
|
||||
if (\count($aIdContacts))
|
||||
{
|
||||
$oStmt->closeCursor();
|
||||
|
||||
|
|
@ -872,7 +872,7 @@ class PdoAddressBook
|
|||
if ($oStmt)
|
||||
{
|
||||
$aFetch = $oStmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||
if (\is_array($aFetch) && 0 < \count($aFetch))
|
||||
if (\is_array($aFetch) && \count($aFetch))
|
||||
{
|
||||
$aNames = array();
|
||||
$aEmails = array();
|
||||
|
|
@ -1014,7 +1014,7 @@ class PdoAddressBook
|
|||
if ($oStmt)
|
||||
{
|
||||
$aFetch = $oStmt->fetchAll(\PDO::FETCH_ASSOC);
|
||||
if (\is_array($aFetch) && 0 < \count($aFetch))
|
||||
if (\is_array($aFetch) && \count($aFetch))
|
||||
{
|
||||
foreach ($aFetch as $aItem)
|
||||
{
|
||||
|
|
@ -1030,7 +1030,7 @@ class PdoAddressBook
|
|||
if ($oItem)
|
||||
{
|
||||
$sEmail = \trim($oItem->GetEmail(true));
|
||||
if (0 < \strlen($sEmail))
|
||||
if (\strlen($sEmail))
|
||||
{
|
||||
$aEmailsToUpdate[] = $sEmail;
|
||||
return !\in_array($sEmail, $aExists);
|
||||
|
|
@ -1047,7 +1047,7 @@ class PdoAddressBook
|
|||
if ($oItem)
|
||||
{
|
||||
$sEmailUpdate = \trim($oItem->GetEmail(true));
|
||||
if (0 < \strlen($sEmailUpdate))
|
||||
if (\strlen($sEmailUpdate))
|
||||
{
|
||||
$aEmailsToUpdate[] = $sEmailUpdate;
|
||||
}
|
||||
|
|
@ -1057,7 +1057,7 @@ class PdoAddressBook
|
|||
|
||||
unset($aEmails, $aEmailsObjects);
|
||||
|
||||
if (0 < \count($aEmailsToCreate))
|
||||
if (\count($aEmailsToCreate))
|
||||
{
|
||||
$oContact = new Classes\Contact();
|
||||
foreach ($aEmailsToCreate as $oEmail)
|
||||
|
|
@ -1086,7 +1086,7 @@ class PdoAddressBook
|
|||
$sFirst = $sFullName;
|
||||
}
|
||||
|
||||
if (0 < \strlen($sFirst))
|
||||
if (\strlen($sFirst))
|
||||
{
|
||||
$oPropName = new Classes\Property();
|
||||
$oPropName->Type = Enumerations\PropertyType::FIRST_NAME;
|
||||
|
|
@ -1095,7 +1095,7 @@ class PdoAddressBook
|
|||
$oContact->Properties[] = $oPropName;
|
||||
}
|
||||
|
||||
if (0 < \strlen($sLast))
|
||||
if (\strlen($sLast))
|
||||
{
|
||||
$oPropName = new Classes\Property();
|
||||
$oPropName->Type = Enumerations\PropertyType::LAST_NAME;
|
||||
|
|
@ -1105,7 +1105,7 @@ class PdoAddressBook
|
|||
}
|
||||
}
|
||||
|
||||
if (0 < \count($oContact->Properties))
|
||||
if (\count($oContact->Properties))
|
||||
{
|
||||
$this->ContactSave($sEmail, $oContact);
|
||||
}
|
||||
|
|
@ -1272,13 +1272,13 @@ SQLITEINITIAL;
|
|||
}
|
||||
|
||||
$aResult = array();
|
||||
if (0 < \strlen($sInitial))
|
||||
if (\strlen($sInitial))
|
||||
{
|
||||
$aList = \explode(';', \trim($sInitial));
|
||||
foreach ($aList as $sV)
|
||||
{
|
||||
$sV = \trim($sV);
|
||||
if (0 < \strlen($sV))
|
||||
if (\strlen($sV))
|
||||
{
|
||||
$aResult[] = $sV;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class DefaultDomain implements \RainLoop\Providers\Domain\DomainAdminInterface
|
|||
if ($this->oCacher)
|
||||
{
|
||||
$sResult = $this->oCacher->Get($this->wildcardDomainsCacheKey());
|
||||
if (0 < \strlen($sResult))
|
||||
if (\strlen($sResult))
|
||||
{
|
||||
return $sResult;
|
||||
}
|
||||
|
|
@ -72,7 +72,7 @@ class DefaultDomain implements \RainLoop\Providers\Domain\DomainAdminInterface
|
|||
}
|
||||
}
|
||||
|
||||
if (0 < \count($aNames))
|
||||
if (\count($aNames))
|
||||
{
|
||||
\rsort($aNames, SORT_STRING);
|
||||
$sResult = \implode(' ', $aNames);
|
||||
|
|
@ -134,10 +134,10 @@ class DefaultDomain implements \RainLoop\Providers\Domain\DomainAdminInterface
|
|||
else if ($bFindWithWildCard)
|
||||
{
|
||||
$sNames = $this->getWildcardDomainsLine();
|
||||
if (0 < \strlen($sNames))
|
||||
if (\strlen($sNames))
|
||||
{
|
||||
if (\RainLoop\Plugins\Helper::ValidateWildcardValues(
|
||||
\MailSo\Base\Utils::IdnToUtf8($sName, true), $sNames, $sFoundedValue) && 0 < \strlen($sFoundedValue))
|
||||
\MailSo\Base\Utils::IdnToUtf8($sName, true), $sNames, $sFoundedValue) && \strlen($sFoundedValue))
|
||||
{
|
||||
if (!$bCheckDisabled || 0 === \strlen($sDisabled) || false === \strpos(','.$sDisabled.',', ','.$sFoundedValue.','))
|
||||
{
|
||||
|
|
@ -213,7 +213,7 @@ class DefaultDomain implements \RainLoop\Providers\Domain\DomainAdminInterface
|
|||
$bResult = true;
|
||||
$sRealFileName = $this->codeFileName($sName);
|
||||
|
||||
if (0 < \strlen($sName))
|
||||
if (\strlen($sName))
|
||||
{
|
||||
if (\file_exists($this->sDomainPath.'/'.$sRealFileName.'.ini'))
|
||||
{
|
||||
|
|
@ -286,10 +286,10 @@ class DefaultDomain implements \RainLoop\Providers\Domain\DomainAdminInterface
|
|||
$aResult = \array_slice($aResult, $iOffset, $iLimit);
|
||||
|
||||
$aDisabledNames = array();
|
||||
if (0 < \count($aResult) && \file_exists($this->sDomainPath.'/disabled'))
|
||||
if (\count($aResult) && \file_exists($this->sDomainPath.'/disabled'))
|
||||
{
|
||||
$sDisabled = \file_get_contents($this->sDomainPath.'/disabled');
|
||||
if (false !== $sDisabled && 0 < strlen($sDisabled))
|
||||
if (false !== $sDisabled && \strlen($sDisabled))
|
||||
{
|
||||
$aDisabledNames = \explode(',', $sDisabled);
|
||||
$aDisabledNames = \array_unique($aDisabledNames);
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ class FileStorage implements \RainLoop\Providers\Files\IFiles
|
|||
|
||||
public function CloseAllOpenedFiles() : bool
|
||||
{
|
||||
if (\is_array($this->aResources) && 0 < \count($this->aResources))
|
||||
if (\is_array($this->aResources) && \count($this->aResources))
|
||||
{
|
||||
foreach ($this->aResources as $sFileName => $rFile)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ class FilterCondition implements \JsonSerializable
|
|||
$aResult = array();
|
||||
foreach ($aCollection as $aItem)
|
||||
{
|
||||
if (\is_array($aItem) && 0 < \count($aItem))
|
||||
if (\is_array($aItem) && \count($aItem))
|
||||
{
|
||||
$oItem = new \RainLoop\Providers\Filters\Classes\FilterCondition();
|
||||
if ($oItem->FromJSON($aItem))
|
||||
|
|
|
|||
|
|
@ -83,8 +83,8 @@ class Sieve
|
|||
$sValue = \trim($oCondition->Value());
|
||||
$sValueSecond = \trim($oCondition->ValueSecond());
|
||||
|
||||
if (0 < \strlen($sValue) ||
|
||||
(0 < \strlen($sValue) && 0 < \strlen($sValueSecond) &&
|
||||
if (\strlen($sValue) ||
|
||||
(\strlen($sValue) && \strlen($sValueSecond) &&
|
||||
Enumerations\ConditionField::HEADER === $oCondition->Field()))
|
||||
{
|
||||
switch ($oCondition->Type())
|
||||
|
|
@ -271,33 +271,33 @@ class Sieve
|
|||
$sValueSecond = \trim($oFilter->ActionValueSecond());
|
||||
$sValueThird = \trim($oFilter->ActionValueThird());
|
||||
$sValueFourth = \trim($oFilter->ActionValueFourth());
|
||||
if (0 < \strlen($sValue))
|
||||
if (\strlen($sValue))
|
||||
{
|
||||
$aCapa['vacation'] = true;
|
||||
|
||||
$iDays = 1;
|
||||
$sSubject = '';
|
||||
if (0 < \strlen($sValueSecond))
|
||||
if (\strlen($sValueSecond))
|
||||
{
|
||||
$sSubject = ':subject "'.
|
||||
static::quote(\MailSo\Base\Utils::StripSpaces($sValueSecond)).'" ';
|
||||
}
|
||||
|
||||
if (0 < \strlen($sValueThird) && \is_numeric($sValueThird) && 1 < (int) $sValueThird)
|
||||
if (\strlen($sValueThird) && \is_numeric($sValueThird) && 1 < (int) $sValueThird)
|
||||
{
|
||||
$iDays = (int) $sValueThird;
|
||||
}
|
||||
|
||||
$sAddresses = '';
|
||||
if (0 < \strlen($sValueFourth))
|
||||
if (\strlen($sValueFourth))
|
||||
{
|
||||
$aAddresses = \explode(',', $sValueFourth);
|
||||
$aAddresses = \array_filter(\array_map(function ($sEmail) use ($self) {
|
||||
$sEmail = \trim($sEmail);
|
||||
return 0 < \strlen($sEmail) ? '"'.static::quote($sEmail).'"' : '';
|
||||
return \strlen($sEmail) ? '"'.static::quote($sEmail).'"' : '';
|
||||
}, $aAddresses), 'strlen');
|
||||
|
||||
if (0 < \count($aAddresses))
|
||||
if (\count($aAddresses))
|
||||
{
|
||||
$sAddresses = ':addresses ['.\implode(', ', $aAddresses).'] ';
|
||||
}
|
||||
|
|
@ -316,7 +316,7 @@ class Sieve
|
|||
break;
|
||||
case Enumerations\ActionType::REJECT:
|
||||
$sValue = \trim($oFilter->ActionValue());
|
||||
if (0 < \strlen($sValue))
|
||||
if (\strlen($sValue))
|
||||
{
|
||||
$aCapa['reject'] = true;
|
||||
|
||||
|
|
@ -333,7 +333,7 @@ class Sieve
|
|||
break;
|
||||
case Enumerations\ActionType::FORWARD:
|
||||
$sValue = $oFilter->ActionValue();
|
||||
if (0 < \strlen($sValue))
|
||||
if (\strlen($sValue))
|
||||
{
|
||||
if ($oFilter->Keep())
|
||||
{
|
||||
|
|
@ -354,7 +354,7 @@ class Sieve
|
|||
break;
|
||||
case Enumerations\ActionType::MOVE_TO:
|
||||
$sValue = $oFilter->ActionValue();
|
||||
if (0 < \strlen($sValue))
|
||||
if (\strlen($sValue))
|
||||
{
|
||||
$sFolderName = $sValue; // utf7-imap
|
||||
if (static::$bUtf8FolderName) // to utf-8
|
||||
|
|
|
|||
|
|
@ -21,13 +21,13 @@ class Suggestions extends \RainLoop\Providers\AbstractProvider
|
|||
});
|
||||
}
|
||||
|
||||
$this->aDrivers = \is_array($aDriver) && 0 < \count($aDriver) ? $aDriver : null;
|
||||
$this->aDrivers = \is_array($aDriver) && \count($aDriver) ? $aDriver : null;
|
||||
}
|
||||
|
||||
public function Process(\RainLoop\Model\Account $oAccount, string $sQuery, int $iLimit = 20) : array
|
||||
{
|
||||
$aSuggestions = array();
|
||||
if ($this->IsActive() && \is_array($this->aDrivers) && 0 < \strlen($sQuery))
|
||||
if ($this->IsActive() && \is_array($this->aDrivers) && \strlen($sQuery))
|
||||
{
|
||||
foreach ($this->aDrivers as $oDriver)
|
||||
{
|
||||
|
|
@ -35,7 +35,7 @@ class Suggestions extends \RainLoop\Providers\AbstractProvider
|
|||
if ($oDriver)
|
||||
{
|
||||
$aSubs = $oDriver->Process($oAccount, $sQuery, $iLimit);
|
||||
if (\is_array($aSubs) && 0 < \count($aSubs))
|
||||
if (\is_array($aSubs) && \count($aSubs))
|
||||
{
|
||||
$aSuggestions = \array_merge($aSuggestions, $aSubs);
|
||||
}
|
||||
|
|
@ -55,6 +55,6 @@ class Suggestions extends \RainLoop\Providers\AbstractProvider
|
|||
|
||||
public function IsActive() : bool
|
||||
{
|
||||
return \is_array($this->aDrivers) && 0 < \count($this->aDrivers);
|
||||
return \is_array($this->aDrivers) && \count($this->aDrivers);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ class Utils
|
|||
$_COOKIE[$sName] = $sValue;
|
||||
\setcookie($sName, $sValue, array(
|
||||
'expires' => $iExpire,
|
||||
'path' => $sPath && 0 < \strlen($sPath) ? $sPath : '/',
|
||||
'path' => $sPath && \strlen($sPath) ? $sPath : '/',
|
||||
// 'domain' => $sDomain,
|
||||
'secure' => isset($_SERVER['HTTPS']) || static::$CookieDefaultSecure,
|
||||
'httponly' => $bHttpOnly,
|
||||
|
|
@ -185,7 +185,7 @@ class Utils
|
|||
unset($_COOKIE[$sName]);
|
||||
\setcookie($sName, '', array(
|
||||
'expires' => \time() - 3600 * 24 * 30,
|
||||
'path' => $sPath && 0 < \strlen($sPath) ? $sPath : '/',
|
||||
'path' => $sPath && \strlen($sPath) ? $sPath : '/',
|
||||
// 'domain' => null,
|
||||
'secure' => isset($_SERVER['HTTPS']) || static::$CookieDefaultSecure,
|
||||
'httponly' => true,
|
||||
|
|
|
|||
|
|
@ -134,13 +134,13 @@
|
|||
<i class="icon-file-text"></i>
|
||||
</button>
|
||||
<button type="button" class="btn" data-bind="click: function () { attachmentsPlace(true); },
|
||||
css: { 'btn-danger': 0 < attachmentsInErrorCount(), 'active': attachmentsPlace() },
|
||||
css: { 'btn-danger': attachmentsInErrorCount(), 'active': attachmentsPlace() },
|
||||
tooltipErrorTip: attachmentsErrorTooltip">
|
||||
<span data-bind="visible: 0 < attachmentsCount()">
|
||||
<span data-bind="visible: attachmentsCount()">
|
||||
<b data-bind="text: attachmentsCount"></b>
|
||||
|
||||
</span>
|
||||
<i data-bind="css: { 'icon-attachment': 0 === attachmentsInProcessCount(), 'icon-spinner': 0 < attachmentsInProcessCount()}"></i>
|
||||
<i data-bind="css: { 'icon-attachment': !attachmentsInProcessCount(), 'icon-spinner': attachmentsInProcessCount()}"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
|
|
|
|||
|
|
@ -66,10 +66,10 @@
|
|||
autocomplete="current-password" autocorrect="off" autocapitalize="off" spellcheck="false"
|
||||
data-i18n="[placeholder]GLOBAL/PASSWORD"
|
||||
data-bind="textInput: password, onEnter: doCommand" />
|
||||
<select class="input-block-level" data-bind="visible: 0 < privateKeysOptions().length, options: privateKeysOptions, value: selectedPrivateKey,
|
||||
<select class="input-block-level" data-bind="visible: privateKeysOptions().length, options: privateKeysOptions, value: selectedPrivateKey,
|
||||
optionsCaption: privateKeysOptionsCaption, optionsText: 'name', optionsValue: 'id'"></select>
|
||||
</div>
|
||||
<select class="input-block-level" data-bind="visible: encrypt() && 0 < publicKeysOptions().length, options: publicKeysOptions, value: selectedPublicKey,
|
||||
<select class="input-block-level" data-bind="visible: encrypt() && publicKeysOptions().length, options: publicKeysOptions, value: selectedPublicKey,
|
||||
optionsCaption: publicKeysOptionsCaption, optionsText: 'name', optionsValue: 'id'"></select>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@
|
|||
</div>
|
||||
<div class="listEmptySearchList" data-bind="visible: 0 === contacts().length && '' !== search() && !contacts.loading()"
|
||||
data-i18n="CONTACTS/EMPTY_SEARCH"></div>
|
||||
<div class="e-contact-foreach g-ui-user-select-none" data-bind="foreach: contacts, visible: 0 < contacts().length">
|
||||
<div class="e-contact-foreach g-ui-user-select-none" data-bind="foreach: contacts, visible: contacts().length">
|
||||
<div class="e-contact-item g-ui-user-select-none" data-bind="css: lineAsCss()">
|
||||
<div class="checkboxItem fontastic" data-bind="text: checked() ? '☑' : '☐'"></div>
|
||||
<div class="nameParent actionHandle" data-bind="text: display"></div>
|
||||
|
|
@ -138,7 +138,7 @@
|
|||
data-bind="value: value, hasfocus: focused, valueUpdate: 'keyup', attr: {'placeholder': placeholderValue}" />
|
||||
</div>
|
||||
</div>
|
||||
<div data-bind="visible: 0 < viewPropertiesOther().length, foreach: viewPropertiesOther">
|
||||
<div data-bind="visible: viewPropertiesOther().length, foreach: viewPropertiesOther">
|
||||
<div class="property-line">
|
||||
<!-- ko if: !largeValue() -->
|
||||
<span data-bind="text: value"></span>
|
||||
|
|
@ -156,7 +156,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" data-bind="visible: !viewReadOnly() || 0 < viewPropertiesEmails().length">
|
||||
<div class="control-group" data-bind="visible: !viewReadOnly() || viewPropertiesEmails().length">
|
||||
<label class="fontastic iconsize24" data-i18n="[title]GLOBAL/EMAIL">@</label>
|
||||
<div>
|
||||
<div data-bind="foreach: viewPropertiesEmails">
|
||||
|
|
@ -170,7 +170,7 @@
|
|||
<a href="#" class="g-ui-link add-link" data-bind="visible: !viewReadOnly(), click: addNewEmail" data-i18n="CONTACTS/LINK_ADD_EMAIL"></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" data-bind="visible: 0 < viewPropertiesPhones().length">
|
||||
<div class="control-group" data-bind="visible: viewPropertiesPhones().length">
|
||||
<label class="fontastic iconsize24" data-i18n="[title]CONTACTS/LABEL_PHONE">📞</label>
|
||||
<div>
|
||||
<div data-bind="foreach: viewPropertiesPhones">
|
||||
|
|
@ -183,7 +183,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group" data-bind="visible: 0 < viewPropertiesWeb().length">
|
||||
<div class="control-group" data-bind="visible: viewPropertiesWeb().length">
|
||||
<label class="fontastic iconsize24" data-i18n="[title]CONTACTS/LABEL_WEB">🌍</label>
|
||||
<div>
|
||||
<div data-bind="foreach: viewPropertiesWeb">
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
data-i18n="POPUPS_FILTER/SELECT_MATCH_ALL"></option>
|
||||
</select>
|
||||
</div>
|
||||
<div data-bind="visible: 0 < conditions().length, foreach: conditions">
|
||||
<div data-bind="visible: conditions().length, foreach: conditions">
|
||||
<div class="control-group" data-bind="css: {'error': valueError}" style="display:flex">
|
||||
<div style="flex-grow:1" data-bind="css: {'error': valueError}, template: {'name': template(), 'data': $data}"></div>
|
||||
<span class="delete-action button-delete fontastic" style="margin-top: 5px;"
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
<a id="top-system-dropdown-id" href="#" tabindex="-1" class="btn single btn-block dropdown-toggle">
|
||||
<i class="fontastic" data-bind="css: {'icon-spinner': accountsLoading()}">👤</i>
|
||||
<!--
|
||||
<b data-bind="text: accountsUnreadCount, visible: 100 > accountsUnreadCount() && 0 < accountsUnreadCount()"></b>
|
||||
<b data-bind="text: accountsUnreadCount, visible: 100 > accountsUnreadCount() && accountsUnreadCount()"></b>
|
||||
<b data-bind="visible: 99 < accountsUnreadCount()">99+</b>
|
||||
|
||||
-->
|
||||
|
|
@ -21,7 +21,7 @@
|
|||
<!-- ko foreach: accounts -->
|
||||
<li role="presentation">
|
||||
<a class="account-item" href="#" data-bind="click: $root.accountClick, css: {'current': $root.accountEmail() === email}">
|
||||
<!-- <b class="pull-right counter" data-bind="visible: 0 < count()">
|
||||
<!-- <b class="pull-right counter" data-bind="visible: count()">
|
||||
<span data-bind="text: count, visible: 100 > count()"></span>
|
||||
<span data-bind="visible: 99 < count()">99+</span>
|
||||
</b>-->
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue