mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-25 18:19:22 +03:00
Add error message on adminpanel contacts configuration page.
This commit is contained in:
parent
a531846b8f
commit
869e0ed181
9 changed files with 120 additions and 60 deletions
|
|
@ -228,6 +228,16 @@ class Utils
|
|||
return !\preg_match('/[^\x09\x10\x13\x0A\x0D\x20-\x7E]/', $sValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $sValue
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public static function IsUtf8($sValue)
|
||||
{
|
||||
return (bool) \preg_match('//u', $sValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $iSize
|
||||
* @param int $iRound
|
||||
|
|
@ -831,55 +841,55 @@ class Utils
|
|||
{
|
||||
return \json_encode($mInput, defined('JSON_UNESCAPED_UNICODE') ? JSON_UNESCAPED_UNICODE : 0);
|
||||
|
||||
if (\is_null($mInput))
|
||||
{
|
||||
return 'null';
|
||||
}
|
||||
else if ($mInput === false)
|
||||
{
|
||||
return 'false';
|
||||
}
|
||||
else if ($mInput === true)
|
||||
{
|
||||
return 'true';
|
||||
}
|
||||
else if (\is_scalar($mInput))
|
||||
{
|
||||
if (\is_float($mInput))
|
||||
{
|
||||
$mInput = \str_replace(',', '.', \strval($mInput));
|
||||
}
|
||||
|
||||
return '"'.\MailSo\Base\Utils::InlineRebuildStringToJsString($mInput).'"';
|
||||
}
|
||||
|
||||
$bIsList = true;
|
||||
for ($iIndex = 0, \reset($mInput), $iLen = \count($mInput); $iIndex < $iLen; $iIndex++, \next($mInput))
|
||||
{
|
||||
if (\key($mInput) !== $iIndex)
|
||||
{
|
||||
$bIsList = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
$aResult = array();
|
||||
if ($bIsList)
|
||||
{
|
||||
foreach ($mInput as $mValue)
|
||||
{
|
||||
$aResult[] = \MailSo\Base\Utils::Php2js($mValue);
|
||||
}
|
||||
return '['.\join(',', $aResult).']';
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach ($mInput as $sKey => $mValue)
|
||||
{
|
||||
$aResult[] = \MailSo\Base\Utils::Php2js($sKey).':'.\MailSo\Base\Utils::Php2js($mValue);
|
||||
}
|
||||
return '{'.\join(',', $aResult).'}';
|
||||
}
|
||||
// if (\is_null($mInput))
|
||||
// {
|
||||
// return 'null';
|
||||
// }
|
||||
// else if ($mInput === false)
|
||||
// {
|
||||
// return 'false';
|
||||
// }
|
||||
// else if ($mInput === true)
|
||||
// {
|
||||
// return 'true';
|
||||
// }
|
||||
// else if (\is_scalar($mInput))
|
||||
// {
|
||||
// if (\is_float($mInput))
|
||||
// {
|
||||
// $mInput = \str_replace(',', '.', \strval($mInput));
|
||||
// }
|
||||
//
|
||||
// return '"'.\MailSo\Base\Utils::InlineRebuildStringToJsString($mInput).'"';
|
||||
// }
|
||||
//
|
||||
// $bIsList = true;
|
||||
// for ($iIndex = 0, \reset($mInput), $iLen = \count($mInput); $iIndex < $iLen; $iIndex++, \next($mInput))
|
||||
// {
|
||||
// if (\key($mInput) !== $iIndex)
|
||||
// {
|
||||
// $bIsList = false;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// $aResult = array();
|
||||
// if ($bIsList)
|
||||
// {
|
||||
// foreach ($mInput as $mValue)
|
||||
// {
|
||||
// $aResult[] = \MailSo\Base\Utils::Php2js($mValue);
|
||||
// }
|
||||
// return '['.\join(',', $aResult).']';
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// foreach ($mInput as $sKey => $mValue)
|
||||
// {
|
||||
// $aResult[] = \MailSo\Base\Utils::Php2js($sKey).':'.\MailSo\Base\Utils::Php2js($mValue);
|
||||
// }
|
||||
// return '{'.\join(',', $aResult).'}';
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue