Don't suppress functions

This commit is contained in:
djmaze 2020-03-20 15:29:52 +01:00
parent 1009398d0c
commit 559ebe0f28
28 changed files with 244 additions and 265 deletions

View file

@ -528,7 +528,7 @@ class Actions
public function SetAuthLogoutToken() : void
{
@\header('X-RainLoop-Action: Logout');
\header('X-RainLoop-Action: Logout');
\RainLoop\Utils::SetCookie(self::AUTH_SPEC_LOGOUT_TOKEN_KEY, \md5($_SERVER['REQUEST_TIME_FLOAT']), 0);
}
@ -899,9 +899,9 @@ class Actions
$sLogFileFullPath = \APP_PRIVATE_DATA.'logs/'.$this->compileLogFileName($sLogFileName);
$sLogFileDir = \dirname($sLogFileFullPath);
if (!@is_dir($sLogFileDir))
if (!is_dir($sLogFileDir))
{
@mkdir($sLogFileDir, 0755, true);
mkdir($sLogFileDir, 0755, true);
}
$oDriver = \MailSo\Log\Drivers\File::NewInstance($sLogFileFullPath);
@ -937,7 +937,7 @@ class Actions
$sPdo = empty($sPdo) ? '~' : $sPdo;
$this->oLogger->Write('['.
'Suhosin:'.(\extension_loaded('suhosin') || @\ini_get('suhosin.get.max_value_length') ? 'on' : 'off').
'Suhosin:'.(\extension_loaded('suhosin') || \ini_get('suhosin.get.max_value_length') ? 'on' : 'off').
'][APC:'.(\MailSo\Base\Utils::FunctionExistsAndEnabled('apc_fetch') ? 'on' : 'off').
'][MB:'.(\MailSo\Base\Utils::FunctionExistsAndEnabled('mb_convert_encoding') ? 'on' : 'off').
'][PDO:'.$sPdo.
@ -966,9 +966,9 @@ class Actions
$sLogFileDir = \dirname($sAuthLogFileFullPath);
if (!@is_dir($sLogFileDir))
if (!is_dir($sLogFileDir))
{
@mkdir($sLogFileDir, 0755, true);
mkdir($sLogFileDir, 0755, true);
}
$this->oLoggerAuth->AddForbiddenType(\MailSo\Log\Enumerations\Type::MEMORY);
@ -1298,7 +1298,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
if ('' !== $aResult['LoadingDescription'] && 'RainLoop' !== $aResult['LoadingDescription'])
{
$aResult['LoadingDescriptionEsc'] = @\htmlspecialchars($aResult['LoadingDescription'], ENT_QUOTES|ENT_IGNORE, 'UTF-8');
$aResult['LoadingDescriptionEsc'] = \htmlspecialchars($aResult['LoadingDescription'], ENT_QUOTES|ENT_IGNORE, 'UTF-8');
}
$oSettings = null;
@ -2043,7 +2043,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
$aAccounts = array();
if ('' !== $sAccounts && '{' === \substr($sAccounts, 0, 1))
{
$aAccounts = @\json_decode($sAccounts, true);
$aAccounts = \json_decode($sAccounts, true);
}
if (\is_array($aAccounts) && 0 < \count($aAccounts))
@ -2060,7 +2060,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
'accounts_identities_order'
);
$aOrder = empty($sOrder) ? array() : @\json_decode($sOrder, true);
$aOrder = empty($sOrder) ? array() : \json_decode($sOrder, true);
if (isset($aOrder['Accounts']) && \is_array($aOrder['Accounts']) &&
1 < \count($aOrder['Accounts']))
{
@ -2099,7 +2099,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
if ('' !== $sData && '[' === \substr($sData, 0, 1))
{
$aData = @\json_decode($sData, true);
$aData = \json_decode($sData, true);
}
if (\is_array($aData) && 0 < \count($aData))
@ -2123,7 +2123,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
'templates_order'
);
$aOrder = empty($sOrder) ? array() : @\json_decode($sOrder, true);
$aOrder = empty($sOrder) ? array() : \json_decode($sOrder, true);
if (\is_array($aOrder) && 1 < \count($aOrder))
{
\usort($aTemplates, function ($a, $b) use ($aOrder) {
@ -2170,7 +2170,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
if ('' !== $sData && '[' === \substr($sData, 0, 1))
{
$aSubIdentities = @\json_decode($sData, true);
$aSubIdentities = \json_decode($sData, true);
}
$bHasAccountIdentity = false;
@ -2212,7 +2212,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
'accounts_identities_order'
);
$aOrder = empty($sOrder) ? array() : @\json_decode($sOrder, true);
$aOrder = empty($sOrder) ? array() : \json_decode($sOrder, true);
if (isset($aOrder['Identities']) && \is_array($aOrder['Identities']) &&
1 < \count($aOrder['Identities']))
{
@ -2274,7 +2274,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
$this->StorageProvider()->Put($oAccount,
\RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG,
'accounts',
@\json_encode($aAccounts)
\json_encode($aAccounts)
);
}
}
@ -2297,7 +2297,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
return $this->StorageProvider(true)->Put($oAccount,
\RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG,
'identities',
@\json_encode($aResult)
\json_encode($aResult)
);
}
@ -2312,7 +2312,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
return $this->StorageProvider(true)->Put($oAccount,
\RainLoop\Providers\Storage\Enumerations\StorageType::CONFIG,
'templates',
@\json_encode($aResult)
\json_encode($aResult)
);
}
@ -3576,7 +3576,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
if (false !== $sRep)
{
$aRep = @\json_decode($sRep);
$aRep = \json_decode($sRep);
$bReal = \is_array($aRep) && 0 < \count($aRep);
if ($bReal)
@ -3592,7 +3592,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
}
else if ('' !== $sRep)
{
$aRep = @\json_decode($sRep, false, 10);
$aRep = \json_decode($sRep, false, 10);
$bReal = \is_array($aRep) && 0 < \count($aRep);
}
@ -3672,7 +3672,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
if (false !== $sRep)
{
$aRep = @\json_decode($sRep, true, 10);
$aRep = \json_decode($sRep, true, 10);
$bReal = \is_array($aRep) && 0 < \count($aRep) && isset($aRep['id']) && 'rainloop' === $aRep['id'];
if ($bReal)
@ -3688,7 +3688,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
}
else if ('' !== $sRep)
{
$aRep = @\json_decode($sRep, true, 10);
$aRep = \json_decode($sRep, true, 10);
$bReal = \is_array($aRep) && 0 < \count($aRep) && isset($aRep['id']) && 'rainloop' === $aRep['id'];
}
@ -3868,13 +3868,13 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
{
$bResult = false;
$sTmp = APP_PRIVATE_DATA.\md5(\microtime(true).$sUrl).'.zip';
$pDest = @\fopen($sTmp, 'w+b');
$pDest = \fopen($sTmp, 'w+b');
if ($pDest)
{
$iCode = 0;
$sContentType = '';
@\set_time_limit(120);
\set_time_limit(120);
$oHttp = \MailSo\Base\Http::SingletonInstance();
$bResult = $oHttp->SaveUrlToFile($sUrl, $pDest, $sTmp, $sContentType, $iCode, $this->Logger(), 60,
@ -3886,7 +3886,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
$this->Logger()->Write($sUrl.' -> '.$sTmp, \MailSo\Log\Enumerations\Type::ERROR, 'INSTALLER');
}
@\fclose($pDest);
\fclose($pDest);
}
else
{
@ -3959,7 +3959,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
}
$oArchive->close();
@\unlink($sTmp);
\unlink($sTmp);
}
return $this->DefaultResponse(__FUNCTION__, $bResult ?
@ -4625,7 +4625,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
$oSettingsLocal = $this->SettingsProvider(true)->Load($oAccount);
$sCheckableFolder = $oSettingsLocal->GetConf('CheckableFolder', '[]');
$aCheckableFolder = @\json_decode($sCheckableFolder);
$aCheckableFolder = \json_decode($sCheckableFolder);
if (!\is_array($aCheckableFolder))
{
@ -4651,7 +4651,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
$aCheckableFolder = \array_unique($aCheckableFolder);
$oSettingsLocal->SetConf('CheckableFolder', @\json_encode($aCheckableFolder));
$oSettingsLocal->SetConf('CheckableFolder', \json_encode($aCheckableFolder));
return $this->DefaultResponse(__FUNCTION__,
$this->SettingsProvider(true)->Save($oAccount, $oSettingsLocal));
@ -5277,7 +5277,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
$aToCollection = $oMessage->GetTo();
if ($aToCollection && $oFrom)
{
$sRawBody = @\stream_get_contents($rMessageStream);
$sRawBody = \stream_get_contents($rMessageStream);
if (!empty($sRawBody))
{
$sMailTo = \trim($aToCollection->ToString(true));
@ -5492,7 +5492,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
if (\is_resource($rAppendMessageStream))
{
@fclose($rAppendMessageStream);
fclose($rAppendMessageStream);
}
}
}
@ -5504,7 +5504,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
if (\is_resource($rMessageStream))
{
@\fclose($rMessageStream);
\fclose($rMessageStream);
}
$this->deleteMessageAttachmnets($oAccount);
@ -5601,7 +5601,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
if (\is_resource($rMessageStream))
{
@\fclose($rMessageStream);
\fclose($rMessageStream);
}
$mResult = true;
@ -6529,7 +6529,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
if (\is_resource($rFile))
{
@\fclose($rFile);
\fclose($rFile);
}
}
}
@ -6683,9 +6683,9 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
else
{
$rData = $this->FilesProvider()->GetFile($oAccount, $sSavedName);
if (@\is_resource($rData))
if (\is_resource($rData))
{
$sData = @\stream_get_contents($rData);
$sData = \stream_get_contents($rData);
if (!empty($sData) && 0 < \strlen($sData))
{
$sName = $aFile['name'];
@ -6719,9 +6719,9 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
unset($sData);
}
if (@\is_resource($rData))
if (\is_resource($rData))
{
@\fclose($rData);
\fclose($rData);
}
unset($rData);
@ -6770,11 +6770,11 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
}
else
{
@\ini_set('auto_detect_line_endings', true);
\ini_set('auto_detect_line_endings', true);
$mData = $this->FilesProvider()->GetFile($oAccount, $sSavedName);
if ($mData)
{
$sFileStart = @\fread($mData, 20);
$sFileStart = \fread($mData, 20);
\rewind($mData);
if (false !== $sFileStart)
@ -6793,13 +6793,13 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
if (\is_resource($mData))
{
@\fclose($mData);
\fclose($mData);
}
unset($mData);
$this->FilesProvider()->Clear($oAccount, $sSavedName);
@\ini_set('auto_detect_line_endings', false);
\ini_set('auto_detect_line_endings', false);
}
}
@ -6830,7 +6830,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
{
$sDelimiter = ((int) \strpos($sFileStart, ',') > (int) \strpos($sFileStart, ';')) ? ',' : ';';
@\setlocale(LC_CTYPE, 'en_US.UTF-8');
\setlocale(LC_CTYPE, 'en_US.UTF-8');
while (false !== ($mRow = \fgetcsv($rFile, 5000, $sDelimiter, '"')))
{
if (null === $aHeaders)
@ -6946,7 +6946,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
$sUrl = $this->Http()->GetFullUrl().'?/Raw/&q[]=/'.\implode('/', $aParams).'/&q[]=/'.$sLast;
$sFullUrl = 'https://docs.google.com/viewer?embedded=true&url='.\urlencode($sUrl);
@\header('Content-Type: text/html; charset=utf-8');
\header('Content-Type: text/html; charset=utf-8');
echo '<html style="height: 100%; width: 100%; margin: 0; padding: 0"><head></head>'.
'<body style="height: 100%; width: 100%; margin: 0; padding: 0">'.
'<iframe style="height: 100%; width: 100%; margin: 0; padding: 0; border: 0" src="'.$sFullUrl.'"></iframe>'.
@ -7206,14 +7206,14 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
$sHash = \MailSo\Base\Utils::Md5Rand($sFileNameIn.'~'.$sContentTypeIn);
$rTempResource = $oFileProvider->GetFile($oAccount, $sHash, 'wb+');
if (@\is_resource($rTempResource))
if (\is_resource($rTempResource))
{
if (false !== \MailSo\Base\Utils::MultipleStreamWriter($rResource, array($rTempResource)))
{
$sResultHash = $sHash;
}
@\fclose($rTempResource);
\fclose($rTempResource);
}
}
@ -7555,7 +7555,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
{
$this->cacheByKey($sRawKey);
@\header('Content-Type: '.$aData['ContentType']);
\header('Content-Type: '.$aData['ContentType']);
echo \base64_decode($aData['Raw']);
unset($aData);
@ -7591,7 +7591,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
{
$this->cacheByKey($sRawKey);
@\header('Content-Type: '.$sContentType);
\header('Content-Type: '.$sContentType);
echo \preg_replace('/^data:[^:]+:/', '', $sData);
unset($sData);
@ -7839,7 +7839,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
$bDefault = false;
$sList = array();
$sDir = APP_VERSION_ROOT_PATH.'themes';
if (@\is_dir($sDir))
if (\is_dir($sDir))
{
$rDirH = \opendir($sDir);
if ($rDirH)
@ -7862,12 +7862,12 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
}
}
}
@closedir($rDirH);
closedir($rDirH);
}
}
$sDir = APP_INDEX_ROOT_PATH.'themes'; // custom user themes
if (@\is_dir($sDir))
if (\is_dir($sDir))
{
$rDirH = \opendir($sDir);
if ($rDirH)
@ -7880,7 +7880,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
}
}
@\closedir($rDirH);
\closedir($rDirH);
}
}
@ -7917,7 +7917,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
$aTop = array();
$aList = array();
if (@\is_dir($sDir))
if (\is_dir($sDir))
{
$rDirH = \opendir($sDir);
if ($rDirH)
@ -7934,7 +7934,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
}
}
@\closedir($rDirH);
\closedir($rDirH);
}
}
@ -8603,7 +8603,7 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
if (null === $this->oAccount) {
$this->oAccount = $this->getAccountFromToken(false);
}
$aCheckable = @\json_decode(
$aCheckable = \json_decode(
$this->SettingsProvider(true)
->Load($this->oAccount)
->GetConf('CheckableFolder', '[]')

View file

@ -184,7 +184,7 @@ abstract class PdoAbstract
if ($bLogParams && $aLogs)
{
$this->writeLog('Params: '.@\json_encode($aLogs, \defined('JSON_UNESCAPED_UNICODE') ? JSON_UNESCAPED_UNICODE : 0));
$this->writeLog('Params: '.\json_encode($aLogs, JSON_UNESCAPED_UNICODE));
}
}

View file

@ -107,10 +107,10 @@ abstract class AbstractConfig
{
if ($this->bUseApcCache)
{
$iMTime = @\filemtime($this->sFile);
$iMTime = \filemtime($this->sFile);
$iMTime = \is_int($iMTime) && 0 < $iMTime ? $iMTime : 0;
$iATime = $this->sAdditionalFile ? @\filemtime($this->sAdditionalFile) : 0;
$iATime = $this->sAdditionalFile ? \filemtime($this->sAdditionalFile) : 0;
$iATime = \is_int($iATime) && 0 < $iATime ? $iATime : 0;
if (0 < $iMTime)
@ -137,10 +137,10 @@ abstract class AbstractConfig
{
if ($this->bUseApcCache)
{
$iMTime = @\filemtime($this->sFile);
$iMTime = \filemtime($this->sFile);
$iMTime = \is_int($iMTime) && 0 < $iMTime ? $iMTime : 0;
$iATime = $this->sAdditionalFile ? @\filemtime($this->sAdditionalFile) : 0;
$iATime = $this->sAdditionalFile ? \filemtime($this->sAdditionalFile) : 0;
$iATime = \is_int($iATime) && 0 < $iATime ? $iATime : 0;
if (0 < $iMTime)

View file

@ -150,7 +150,7 @@ class Manager
{
$aList = array();
$aGlob = @\glob(APP_PLUGINS_PATH.'*', GLOB_ONLYDIR|GLOB_NOSORT);
$aGlob = \glob(APP_PLUGINS_PATH.'*', GLOB_ONLYDIR|GLOB_NOSORT);
if (\is_array($aGlob))
{
foreach ($aGlob as $sPathName)

View file

@ -131,7 +131,7 @@ class Property
// lower value for searching
if ($this->IsValueForLower() && \MailSo\Base\Utils::FunctionExistsAndEnabled('mb_strtolower'))
{
$this->ValueLower = (string) @\mb_strtolower($this->Value, 'UTF-8');
$this->ValueLower = (string) \mb_strtolower($this->Value, 'UTF-8');
}
// phone value for searching

View file

@ -1869,7 +1869,7 @@ SQLITEINITIAL;
return '%'.\str_replace(array($sEscapeSign, '_', '%'),
array($sEscapeSign.$sEscapeSign, $sEscapeSign.'_', $sEscapeSign.'%'),
(string) @\mb_strtolower($sSearch, 'UTF-8')).'%';
(string) \mb_strtolower($sSearch, 'UTF-8')).'%';
}
private function specialConvertSearchValueCustomPhone(string $sSearch) : string

View file

@ -97,7 +97,7 @@ class DefaultDomain implements \RainLoop\Providers\Domain\DomainAdminInterface
if (\file_exists($this->sDomainPath.'/disabled'))
{
$sDisabled = @\file_get_contents($this->sDomainPath.'/disabled');
$sDisabled = \file_get_contents($this->sDomainPath.'/disabled');
}
if (\file_exists($this->sDomainPath.'/'.$sRealFileName.'.ini') &&
@ -183,7 +183,7 @@ class DefaultDomain implements \RainLoop\Providers\Domain\DomainAdminInterface
$sFile = '';
if (\file_exists($this->sDomainPath.'/disabled'))
{
$sFile = @\file_get_contents($this->sDomainPath.'/disabled');
$sFile = \file_get_contents($this->sDomainPath.'/disabled');
}
$aResult = array();
@ -245,7 +245,7 @@ class DefaultDomain implements \RainLoop\Providers\Domain\DomainAdminInterface
$aAliases = array();
// $aList = \glob($this->sDomainPath.'/*.{ini,alias}', GLOB_BRACE);
$aList = @\array_diff(\scandir($this->sDomainPath), array('.', '..'));
$aList = \array_diff(\scandir($this->sDomainPath), array('.', '..'));
if (\is_array($aList))
{
foreach ($aList as $sFile)
@ -291,7 +291,7 @@ class DefaultDomain implements \RainLoop\Providers\Domain\DomainAdminInterface
$aDisabledNames = array();
if (0 < \count($aResult) && \file_exists($this->sDomainPath.'/disabled'))
{
$sDisabled = @\file_get_contents($this->sDomainPath.'/disabled');
$sDisabled = \file_get_contents($this->sDomainPath.'/disabled');
if (false !== $sDisabled && 0 < strlen($sDisabled))
{
$aDisabledNames = \explode(',', $sDisabled);

View file

@ -30,11 +30,11 @@ class FileStorage implements \RainLoop\Providers\Files\IFiles
$bResult = false;
if ($rSource)
{
$rOpenOutput = @\fopen($this->generateFullFileName($oAccount, $sKey, true), 'w+b');
$rOpenOutput = \fopen($this->generateFullFileName($oAccount, $sKey, true), 'w+b');
if ($rOpenOutput)
{
$bResult = (false !== \MailSo\Base\Utils::MultipleStreamWriter($rSource, array($rOpenOutput)));
@\fclose($rOpenOutput);
\fclose($rOpenOutput);
}
}
return $bResult;
@ -42,7 +42,7 @@ class FileStorage implements \RainLoop\Providers\Files\IFiles
public function MoveUploadedFile(\RainLoop\Model\Account $oAccount, string $sKey, string $sSource) : bool
{
return @\move_uploaded_file($sSource,
return \move_uploaded_file($sSource,
$this->generateFullFileName($oAccount, $sKey, true));
}
@ -57,7 +57,7 @@ class FileStorage implements \RainLoop\Providers\Files\IFiles
$sFileName = $this->generateFullFileName($oAccount, $sKey, $bCreate);
if ($bCreate || \file_exists($sFileName))
{
$mResult = @\fopen($sFileName, $sOpenMode);
$mResult = \fopen($sFileName, $sOpenMode);
if (\is_resource($mResult))
{
@ -88,10 +88,10 @@ class FileStorage implements \RainLoop\Providers\Files\IFiles
{
if (isset($this->aResources[$sFileName]) && \is_resource($this->aResources[$sFileName]))
{
@\fclose($this->aResources[$sFileName]);
\fclose($this->aResources[$sFileName]);
}
$mResult = @\unlink($sFileName);
$mResult = \unlink($sFileName);
}
return $mResult;
@ -111,7 +111,7 @@ class FileStorage implements \RainLoop\Providers\Files\IFiles
public function FileExists(\RainLoop\Model\Account $oAccount, string $sKey) : bool
{
return @\file_exists($this->generateFullFileName($oAccount, $sKey));
return \file_exists($this->generateFullFileName($oAccount, $sKey));
}
public function GC(int $iTimeToClearInHours = 24) : bool
@ -133,7 +133,7 @@ class FileStorage implements \RainLoop\Providers\Files\IFiles
{
if (!empty($sFileName) && \is_resource($rFile))
{
@\fclose($rFile);
\fclose($rFile);
}
}
}
@ -166,9 +166,9 @@ class FileStorage implements \RainLoop\Providers\Files\IFiles
(0 < \strlen($sSubEmail) ? $sSubEmail.'/' : '').
$sKeyPath;
if ($bMkDir && !empty($sFilePath) && !@\is_dir(\dirname($sFilePath)))
if ($bMkDir && !empty($sFilePath) && !\is_dir(\dirname($sFilePath)))
{
if (!@\mkdir(\dirname($sFilePath), 0755, true))
if (!\mkdir(\dirname($sFilePath), 0755, true))
{
throw new \RainLoop\Exceptions\Exception('Can\'t make storage directory "'.$sFilePath.'"');
}

View file

@ -31,7 +31,7 @@ class FileStorage implements \RainLoop\Providers\Storage\IStorage
*/
public function Put($oAccount, int $iStorageType, string $sKey, string $sValue) : bool
{
return false !== @\file_put_contents(
return false !== \file_put_contents(
$this->generateFileName($oAccount, $iStorageType, $sKey, true), $sValue);
}
@ -62,7 +62,7 @@ class FileStorage implements \RainLoop\Providers\Storage\IStorage
$sFileName = $this->generateFileName($oAccount, $iStorageType, $sKey);
if (\file_exists($sFileName))
{
$mResult = @\unlink($sFileName);
$mResult = \unlink($sFileName);
}
return $mResult;
@ -154,9 +154,9 @@ class FileStorage implements \RainLoop\Providers\Storage\IStorage
($bForDeleteAction ? '' : $sKeyPath);
}
if ($bMkDir && !$bForDeleteAction && !empty($sFilePath) && !@\is_dir(\dirname($sFilePath)))
if ($bMkDir && !$bForDeleteAction && !empty($sFilePath) && !\is_dir(\dirname($sFilePath)))
{
if (!@\mkdir(\dirname($sFilePath), 0755, true))
if (!\mkdir(\dirname($sFilePath), 0755, true))
{
throw new \RainLoop\Exceptions\Exception('Can\'t make storage directory "'.$sFilePath.'"');
}

View file

@ -9,7 +9,7 @@ class TemproryApcStorage extends \RainLoop\Providers\Storage\FileStorage
*/
public function Put($oAccount, int $iStorageType, string $sKey, string $sValue) : bool
{
return !!@\apc_store($this->generateFileName($oAccount, $iStorageType, $sKey, true), $sValue);
return !!\apc_store($this->generateFileName($oAccount, $iStorageType, $sKey, true), $sValue);
}
/**
@ -21,7 +21,7 @@ class TemproryApcStorage extends \RainLoop\Providers\Storage\FileStorage
public function Get($oAccount, int $iStorageType, string $sKey, $mDefault = false)
{
$bValue = false;
$mValue = @\apc_fetch($this->generateFileName($oAccount, $iStorageType, $sKey), $bValue);
$mValue = \apc_fetch($this->generateFileName($oAccount, $iStorageType, $sKey), $bValue);
if (!$bValue)
{
$mValue = $mDefault;
@ -35,7 +35,7 @@ class TemproryApcStorage extends \RainLoop\Providers\Storage\FileStorage
*/
public function Clear($oAccount, int $iStorageType, string $sKey) : bool
{
@\apc_delete($this->generateFileName($oAccount, $iStorageType, $sKey));
\apc_delete($this->generateFileName($oAccount, $iStorageType, $sKey));
return true;
}

View file

@ -35,24 +35,24 @@ class Service
$sServer = \trim($this->oActions->Config()->Get('security', 'custom_server_signature', ''));
if (0 < \strlen($sServer))
{
@\header('Server: '.$sServer, true);
\header('Server: '.$sServer, true);
}
$sXFrameOptionsHeader = \trim($this->oActions->Config()->Get('security', 'x_frame_options_header', ''));
if (0 < \strlen($sXFrameOptionsHeader))
{
@\header('X-Frame-Options: '.$sXFrameOptionsHeader, true);
\header('X-Frame-Options: '.$sXFrameOptionsHeader, true);
}
$sXssProtectionOptionsHeader = \trim($this->oActions->Config()->Get('security', 'x_xss_protection_header', ''));
if (0 < \strlen($sXssProtectionOptionsHeader))
{
@\header('X-XSS-Protection: '.$sXssProtectionOptionsHeader, true);
\header('X-XSS-Protection: '.$sXssProtectionOptionsHeader, true);
}
if ($this->oActions->Config()->Get('labs', 'force_https', false) && !$this->oHttp->IsSecure())
{
@\header('Location: https://'.$this->oHttp->GetHost(false, false).$this->oHttp->GetUrl(), true);
\header('Location: https://'.$this->oHttp->GetHost(false, false).$this->oHttp->GetUrl(), true);
exit(0);
}
@ -157,13 +157,13 @@ class Service
}
}
@\header('Content-Security-Policy:');
@\header_remove('Content-Security-Policy');
\header('Content-Security-Policy:');
\header_remove('Content-Security-Policy');
@header('Content-Type: text/html; charset=utf-8');
header('Content-Type: text/html; charset=utf-8');
$this->oHttp->ServerNoCache();
if (!@\is_dir(APP_DATA_FOLDER_PATH) || !@\is_writable(APP_DATA_FOLDER_PATH))
if (!\is_dir(APP_DATA_FOLDER_PATH) || !\is_writable(APP_DATA_FOLDER_PATH))
{
echo $this->oServiceActions->ErrorTemplates(
'Permission denied!',
@ -214,7 +214,7 @@ class Service
}
else
{
@\header('X-XSS-Protection: 1; mode=block');
\header('X-XSS-Protection: 1; mode=block');
}
// Output result

View file

@ -76,7 +76,7 @@ class ServiceActions
public function ServiceAjax() : string
{
@\ob_start();
\ob_start();
$aResponseItem = null;
$oException = null;
@ -187,11 +187,11 @@ class ServiceActions
$this->Plugins()->RunHook('filter.ajax-response', array($sAction, &$aResponseItem));
@\header('Content-Type: application/json; charset=utf-8');
\header('Content-Type: application/json; charset=utf-8');
$sResult = \MailSo\Base\Utils::Php2js($aResponseItem, $this->Logger());
$sObResult = @\ob_get_clean();
$sObResult = \ob_get_clean();
if ($this->Logger()->IsEnabled())
{
@ -215,7 +215,7 @@ class ServiceActions
public function ServiceAppend() : string
{
@\ob_start();
\ob_start();
$bResponse = false;
$oException = null;
try
@ -232,10 +232,10 @@ class ServiceActions
$bResponse = false;
}
@\header('Content-Type: text/plain; charset=utf-8');
\header('Content-Type: text/plain; charset=utf-8');
$sResult = true === $bResponse ? '1' : '0';
$sObResult = @\ob_get_clean();
$sObResult = \ob_get_clean();
if (0 < \strlen($sObResult))
{
$this->Logger()->Write($sObResult, \MailSo\Log\Enumerations\Type::ERROR, 'OB-DATA');
@ -255,7 +255,7 @@ class ServiceActions
{
$oConfig = $this->Config();
@\ob_start();
\ob_start();
$aResponseItem = null;
try
{
@ -314,17 +314,17 @@ class ServiceActions
if ('iframe' === $this->oHttp->GetPost('jua-post-type', ''))
{
@\header('Content-Type: text/html; charset=utf-8');
\header('Content-Type: text/html; charset=utf-8');
}
else
{
@\header('Content-Type: application/json; charset=utf-8');
\header('Content-Type: application/json; charset=utf-8');
}
$this->Plugins()->RunHook('filter.upload-response', array(&$aResponseItem));
$sResult = \MailSo\Base\Utils::Php2js($aResponseItem, $this->Logger());
$sObResult = @\ob_get_clean();
$sObResult = \ob_get_clean();
if (0 < \strlen($sObResult))
{
$this->Logger()->Write($sObResult, \MailSo\Log\Enumerations\Type::ERROR, 'OB-DATA');
@ -401,8 +401,8 @@ class ServiceActions
$sMethodName = 'Raw'.$sAction;
if (\method_exists($this->oActions, $sMethodName))
{
@\header('X-Raw-Action: '.$sMethodName, true);
@\header('Content-Security-Policy: script-src \'none\'; frame-src \'none\'; child-src \'none\'', true);
\header('X-Raw-Action: '.$sMethodName, true);
\header('Content-Security-Policy: script-src \'none\'; frame-src \'none\'; child-src \'none\'', true);
$sRawError = '';
$this->oActions->SetActionParams(array(
@ -462,7 +462,7 @@ class ServiceActions
{
// sleep(2);
$sResult = '';
@\header('Content-Type: application/javascript; charset=utf-8');
\header('Content-Type: application/javascript; charset=utf-8');
if (!empty($this->aPaths[3]))
{
@ -505,7 +505,7 @@ class ServiceActions
public function ServiceTemplates() : string
{
$sResult = '';
@\header('Content-Type: application/javascript; charset=utf-8');
\header('Content-Type: application/javascript; charset=utf-8');
$bCacheEnabled = $this->Config()->Get('labs', 'cache_system_data', true);
if ($bCacheEnabled)
@ -544,7 +544,7 @@ class ServiceActions
$sResult = '';
$bAdmin = !empty($this->aPaths[2]) && 'Admin' === $this->aPaths[2];
@\header('Content-Type: application/javascript; charset=utf-8');
\header('Content-Type: application/javascript; charset=utf-8');
$bCacheEnabled = $this->Config()->Get('labs', 'cache_system_data', true);
if ($bCacheEnabled)
@ -585,11 +585,11 @@ class ServiceActions
if ($bJson)
{
@\header('Content-Type: application/json; charset=utf-8');
\header('Content-Type: application/json; charset=utf-8');
}
else
{
@\header('Content-Type: text/css; charset=utf-8');
\header('Content-Type: text/css; charset=utf-8');
}
$sTheme = '';
@ -717,7 +717,7 @@ class ServiceActions
$sTitle = $this->oActions->StaticI18N('STATIC/BAD_BROWSER_TITLE');
$sDesc = \nl2br($this->oActions->StaticI18N('STATIC/BAD_BROWSER_DESC'));
@\header('Content-Type: text/html; charset=utf-8');
\header('Content-Type: text/html; charset=utf-8');
return \strtr(\file_get_contents(APP_VERSION_ROOT_PATH.'app/templates/BadBrowser.html'), array(
'{{BaseWebStaticPath}}' => \RainLoop\Utils::WebStaticPath(),
'{{ErrorTitle}}' => $sTitle,
@ -748,7 +748,7 @@ class ServiceActions
{
$this->oHttp->ServerNoCache();
@\header('Content-Type: text/plain; charset=utf-8');
\header('Content-Type: text/plain; charset=utf-8');
$this->oActions->Logger()->Write('Pong', \MailSo\Log\Enumerations\Type::INFO, 'PING');
return 'Pong';
}
@ -759,7 +759,7 @@ class ServiceActions
if ($this->oActions->IsAdminLoggined(false))
{
@\header('Content-Type: text/html; charset=utf-8');
\header('Content-Type: text/html; charset=utf-8');
\phpinfo();
}
}
@ -888,7 +888,7 @@ class ServiceActions
{
case 'json':
@\header('Content-Type: application/json; charset=utf-8');
\header('Content-Type: application/json; charset=utf-8');
$aResult = array(
'Action' => 'ExternalLogin',
@ -972,13 +972,13 @@ class ServiceActions
private function localError(string $sTitle, string $sDesc) : string
{
@header('Content-Type: text/html; charset=utf-8');
header('Content-Type: text/html; charset=utf-8');
return $this->ErrorTemplates($sTitle, \nl2br($sDesc));
}
private function localAppData(bool $bAdmin = false, string $sAdd = '') : string
{
@\header('Content-Type: application/javascript; charset=utf-8');
\header('Content-Type: application/javascript; charset=utf-8');
$this->oHttp->ServerNoCache();
$sAuthAccountHash = '';

View file

@ -27,7 +27,7 @@ class Utils
$sKeyFile = APP_VERSION_ROOT_PATH.'app/resources/RainLoop.asc';
if (\file_exists($sKeyFile) && \file_exists($sFileName) && !empty($sSignature))
{
$sKeyFile = @\file_get_contents($sKeyFile);
$sKeyFile = \file_get_contents($sKeyFile);
return !empty($sKeyFile); // TODO
}
@ -73,7 +73,7 @@ class Utils
}
$aString[] = $sKey;
$sResult = @\serialize($aString);
$sResult = \serialize($aString);
\openssl_free_key($oPubKey);
}
@ -94,7 +94,7 @@ class Utils
{
$oPrivKey = \openssl_pkey_get_private($sPrivateKey);
$aString = @\unserialize($sString);
$aString = \unserialize($sString);
if (\is_array($aString))
{
if ($sKey === \array_pop($aString))
@ -153,12 +153,12 @@ class Utils
static public function EncodeKeyValues(array $aValues, string $sCustomKey = '') : string
{
return \MailSo\Base\Utils::UrlSafeBase64Encode(
static::EncryptString(@\serialize($aValues), \md5(APP_SALT.$sCustomKey)));
static::EncryptString(\serialize($aValues), \md5(APP_SALT.$sCustomKey)));
}
static public function DecodeKeyValues(string $sEncodedValues, string $sCustomKey = '') : array
{
$aResult = @\unserialize(
$aResult = \unserialize(
static::DecryptString(
\MailSo\Base\Utils::UrlSafeBase64Decode($sEncodedValues), \md5(APP_SALT.$sCustomKey)));
@ -169,12 +169,12 @@ class Utils
{
return \MailSo\Base\Utils::UrlSafeBase64Encode(
static::EncryptStringQ(
@\serialize($aValues), \md5(APP_SALT.$sCustomKey)));
\serialize($aValues), \md5(APP_SALT.$sCustomKey)));
}
static public function DecodeKeyValuesQ(string $sEncodedValues, string $sCustomKey = '') : array
{
$aResult = @\unserialize(
$aResult = \unserialize(
static::DecryptStringQ(
\MailSo\Base\Utils::UrlSafeBase64Decode($sEncodedValues), \md5(APP_SALT.$sCustomKey)));
@ -233,7 +233,7 @@ class Utils
public static function PathMD5(string $sPath) : string
{
$sResult = '';
if (@\is_dir($sPath))
if (\is_dir($sPath))
{
$oDirIterator = new \RecursiveDirectoryIterator($sPath);
$oIterator = new \RecursiveIteratorIterator($oDirIterator, \RecursiveIteratorIterator::SELF_FIRST);
@ -297,11 +297,11 @@ class Utils
public static function FolderFiles(string $sDir, string $sType = '') : array
{
$aResult = array();
if (@\is_dir($sDir))
if (\is_dir($sDir))
{
if (false !== ($rDirHandle = @\opendir($sDir)))
if (false !== ($rDirHandle = \opendir($sDir)))
{
while (false !== ($sFile = @\readdir($rDirHandle)))
while (false !== ($sFile = \readdir($rDirHandle)))
{
if (empty($sType) || $sType === \substr($sFile, -\strlen($sType)))
{
@ -312,7 +312,7 @@ class Utils
}
}
@\closedir($rDirHandle);
\closedir($rDirHandle);
}
}
@ -392,7 +392,7 @@ class Utils
}
static::$Cookies[$sName] = $sValue;
@\setcookie($sName, $sValue, $iExpire, $sPath, $sDomain, $bSecure, $bHttpOnly);
\setcookie($sName, $sValue, $iExpire, $sPath, $sDomain, $bSecure, $bHttpOnly);
}
public static function ClearCookie(string $sName)
@ -406,7 +406,7 @@ class Utils
$sPath = $sPath && 0 < \strlen($sPath) ? $sPath : null;
unset(static::$Cookies[$sName]);
@\setcookie($sName, '', \time() - 3600 * 24 * 30, $sPath);
\setcookie($sName, '', \time() - 3600 * 24 * 30, $sPath);
}
public static function UrlEncode(string $sV, bool $bEncode = false) : string
@ -455,11 +455,11 @@ class Utils
{
// if (\MailSo\Base\Utils::FunctionExistsAndEnabled('parse_ini_file'))
// {
// return @\parse_ini_file($sFileName, !!$bProcessSections);
// return \parse_ini_file($sFileName, !!$bProcessSections);
// }
$sData = @\file_get_contents($sFileName);
return \is_string($sData) ? @\parse_ini_string($sData, !!$bProcessSections) : null;
$sData = \file_get_contents($sFileName);
return \is_string($sData) ? \parse_ini_string($sData, !!$bProcessSections) : null;
}
public static function CustomBaseConvert(string $sNumberInput, string $sFromBaseInput = '0123456789', string $sToBaseInput = '0123456789')