mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Removed unused CopyDir() and InlineRebuildStringToJsString()
Bugfix StrMailDomainToLower()
This commit is contained in:
parent
b0463f3bff
commit
1da2bb045f
2 changed files with 7 additions and 51 deletions
|
|
@ -55,12 +55,12 @@ abstract class HtmlUtils
|
||||||
$sText = static::ClearBodyAndHtmlTag($sText, $sHtmlAttrs, $sBodyAttrs);
|
$sText = static::ClearBodyAndHtmlTag($sText, $sHtmlAttrs, $sBodyAttrs);
|
||||||
|
|
||||||
$oDom = self::createDOMDocument();
|
$oDom = self::createDOMDocument();
|
||||||
@$oDom->loadHTML('<'.'?xml version="1.0" encoding="utf-8"?'.'>'.
|
$oDom->loadHTML('<?xml version="1.0" encoding="utf-8"?>'.
|
||||||
'<html '.$sHtmlAttrs.'><head>'.
|
'<html '.$sHtmlAttrs.'><head>'.
|
||||||
'<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>'.
|
'<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>'.
|
||||||
'<body '.$sBodyAttrs.'>'.\MailSo\Base\Utils::Utf8Clear($sText).'</body></html>');
|
'<body '.$sBodyAttrs.'>'.\MailSo\Base\Utils::Utf8Clear($sText).'</body></html>');
|
||||||
|
|
||||||
@$oDom->normalizeDocument();
|
$oDom->normalizeDocument();
|
||||||
|
|
||||||
if (\MailSo\Base\Utils::FunctionExistsAndEnabled('libxml_clear_errors'))
|
if (\MailSo\Base\Utils::FunctionExistsAndEnabled('libxml_clear_errors'))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -212,10 +212,10 @@ abstract class Utils
|
||||||
|
|
||||||
public static function StrMailDomainToLower(string $sValue) : string
|
public static function StrMailDomainToLower(string $sValue) : string
|
||||||
{
|
{
|
||||||
$aParts = \explode('@', $sValue, 2);
|
$aParts = \explode('@', $sValue);
|
||||||
if (!empty($aParts[1]))
|
$iLast = \count($aParts) - 1;
|
||||||
{
|
if ($iLast) {
|
||||||
$aParts[1] = \mb_strtolower($aParts[1]);
|
$aParts[$iLast] = \mb_strtolower($aParts[$iLast]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return \implode('@', $aParts);
|
return \implode('@', $aParts);
|
||||||
|
|
@ -633,6 +633,7 @@ abstract class Utils
|
||||||
'bz' => 'application/x-bzip',
|
'bz' => 'application/x-bzip',
|
||||||
'bz2' => 'application/x-bzip2',
|
'bz2' => 'application/x-bzip2',
|
||||||
'deb' => 'application/x-debian-package',
|
'deb' => 'application/x-debian-package',
|
||||||
|
'tar' => 'application/x-tar',
|
||||||
|
|
||||||
// fonts
|
// fonts
|
||||||
'psf' => 'application/x-font-linux-psf',
|
'psf' => 'application/x-font-linux-psf',
|
||||||
|
|
@ -811,17 +812,6 @@ abstract class Utils
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function InlineRebuildStringToJsString(string $sText) : string
|
|
||||||
{
|
|
||||||
static $aJsonReplaces = array(
|
|
||||||
array('\\', "\n", "\t", "\r", '\b', "\f", '"'),
|
|
||||||
array('\\\\', '\\n', '\\t', '\\r', '\\b', '\\f', '\"')
|
|
||||||
);
|
|
||||||
|
|
||||||
return \str_replace('</script>', '<\/script>',
|
|
||||||
\str_replace($aJsonReplaces[0], $aJsonReplaces[1], $sText));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function ClearArrayUtf8Values(array &$aInput)
|
public static function ClearArrayUtf8Values(array &$aInput)
|
||||||
{
|
{
|
||||||
foreach ($aInput as $mKey => $mItem)
|
foreach ($aInput as $mKey => $mItem)
|
||||||
|
|
@ -921,40 +911,6 @@ abstract class Utils
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function CopyDir(string $sSource, string $sDestination)
|
|
||||||
{
|
|
||||||
if (\is_dir($sSource))
|
|
||||||
{
|
|
||||||
if (!\is_dir($sDestination))
|
|
||||||
{
|
|
||||||
\mkdir($sDestination);
|
|
||||||
}
|
|
||||||
|
|
||||||
$oDirectory = \dir($sSource);
|
|
||||||
if ($oDirectory)
|
|
||||||
{
|
|
||||||
while (false !== ($sRead = $oDirectory->read()))
|
|
||||||
{
|
|
||||||
if ('.' === $sRead || '..' === $sRead)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
$sPathDir = $sSource.'/'.$sRead;
|
|
||||||
if (\is_dir($sPathDir))
|
|
||||||
{
|
|
||||||
static::CopyDir($sPathDir, $sDestination.'/'.$sRead);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
\copy($sPathDir, $sDestination.'/'.$sRead);
|
|
||||||
}
|
|
||||||
|
|
||||||
$oDirectory->close();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static function RecTimeDirRemove(string $sTempPath, int $iTime2Kill, int $iNow = 0) : bool
|
public static function RecTimeDirRemove(string $sTempPath, int $iTime2Kill, int $iNow = 0) : bool
|
||||||
{
|
{
|
||||||
$iNow = $iNow ?: \time();
|
$iNow = $iNow ?: \time();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue