Minor changes

This commit is contained in:
Visman 2023-11-22 23:21:30 +07:00
parent 13598f350e
commit e88121236c
7 changed files with 27 additions and 14 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
/_*
/.htaccess /.htaccess
/index.php /index.php
/app/config/main.php /app/config/main.php

View file

@ -46,7 +46,6 @@ class Primary
$confChange = [ $confChange = [
'multiple' => [ 'multiple' => [
'CtrlRouting' => \ForkBB\Controllers\Update::class, 'CtrlRouting' => \ForkBB\Controllers\Update::class,
'AdminUpdate' => \ForkBB\Models\Pages\Admin\Update::class, 'AdminUpdate' => \ForkBB\Models\Pages\Admin\Update::class,
], ],
]; ];

View file

@ -639,7 +639,6 @@ class Routing
'Moderate:action', 'Moderate:action',
'Moderate' 'Moderate'
); );
} }
// только админ // только админ

View file

@ -172,6 +172,7 @@ class Config
switch ($type) { switch ($type) {
case 'ZERO': case 'ZERO':
$type = 'NEW'; $type = 'NEW';
break; break;
case 'NEW': case 'NEW':
case '=>': case '=>':
@ -180,6 +181,7 @@ class Config
$value_before = $other; $value_before = $other;
$other = ''; $other = '';
$type = 'VALUE'; $type = 'VALUE';
break; break;
default: default:
throw new ForkException('Config array cannot be parsed (3)'); throw new ForkException('Config array cannot be parsed (3)');
@ -219,6 +221,7 @@ class Config
case 'VALUE': case 'VALUE':
case 'VALUE_OR_KEY': case 'VALUE_OR_KEY':
$type = 'NEW'; $type = 'NEW';
break; break;
default: default:
throw new ForkException('Config array cannot be parsed (6)'); throw new ForkException('Config array cannot be parsed (6)');
@ -234,6 +237,7 @@ class Config
$value = null; $value = null;
$value_before = ''; $value_before = '';
$type = '=>'; $type = '=>';
break; break;
default: default:
throw new ForkException('Config array cannot be parsed (7)'); throw new ForkException('Config array cannot be parsed (7)');
@ -251,7 +255,8 @@ class Config
case 'VALUE_OR_KEY': case 'VALUE_OR_KEY':
case 'VALUE': case 'VALUE':
case '=>': case '=>':
$other .= $token; $other .= $token;
break; break;
default: default:
throw new ForkException('Config array cannot be parsed (8)'); throw new ForkException('Config array cannot be parsed (8)');
@ -291,9 +296,11 @@ class Config
} }
$type = 'VALUE_OR_KEY'; $type = 'VALUE_OR_KEY';
break; break;
case '=>': case '=>':
$type = 'VALUE'; $type = 'VALUE';
break; break;
default: default:
throw new ForkException('Config array cannot be parsed (10)'); throw new ForkException('Config array cannot be parsed (10)');
@ -311,11 +318,11 @@ class Config
protected function isFormat(mixed $data): bool protected function isFormat(mixed $data): bool
{ {
return \is_array($data) return \is_array($data)
&& \array_key_exists('value', $data) && \array_key_exists('value', $data)
&& \array_key_exists('value_before', $data) && \array_key_exists('value_before', $data)
&& \array_key_exists('value_after', $data) && \array_key_exists('value_after', $data)
&& \array_key_exists('key_before', $data) && \array_key_exists('key_before', $data)
&& \array_key_exists('key_after', $data); && \array_key_exists('key_after', $data);
} }
/** /**
@ -429,6 +436,7 @@ class Config
return false; return false;
} else { } else {
$result = $config[$key]; $result = $config[$key];
unset($config[$key]); unset($config[$key]);
return $result; return $result;

View file

@ -226,10 +226,12 @@ class DB
case 's': case 's':
case 'f': case 'f':
$value = [1]; $value = [1];
break; break;
default: default:
$value = [1]; $value = [1];
$type = 's'; $type = 's';
break; break;
} }

View file

@ -67,8 +67,8 @@ class ErrorHandler
\set_error_handler([$this, 'errorHandler'], \E_ALL); \set_error_handler([$this, 'errorHandler'], \E_ALL);
\set_exception_handler([$this, 'exceptionHandler']); \set_exception_handler([$this, 'exceptionHandler']);
\register_shutdown_function([$this, 'shutdownHandler']); \register_shutdown_function([$this, 'shutdownHandler']);
\ob_start(); \ob_start();
$this->obLevel = \ob_get_level(); $this->obLevel = \ob_get_level();
} }
@ -198,6 +198,7 @@ class ErrorHandler
if (isset($error['exception'])) { if (isset($error['exception'])) {
$context['exception'] = $error['exception']; $context['exception'] = $error['exception'];
} }
$context['headers'] = false; $context['headers'] = false;
$this->c->Log->{$method}($this->message($error), $context); $this->c->Log->{$method}($this->message($error), $context);
@ -279,15 +280,19 @@ EOT;
switch ($type) { switch ($type) {
case 'boolean': case 'boolean':
$type = $arg ? 'true' : 'false'; $type = $arg ? 'true' : 'false';
break; break;
case 'array': case 'array':
$type .= '(' . \count($arg) . ')'; $type .= '(' . \count($arg) . ')';
break; break;
case 'resource': case 'resource':
$type = \get_resource_type($arg); $type = \get_resource_type($arg);
break; break;
case 'object': case 'object':
$type .= '{' . \get_class($arg) . '}'; $type .= '{' . \get_class($arg) . '}';
break; break;
} }
@ -296,8 +301,8 @@ EOT;
} }
} }
$line .= ')'; $line .= ')';
$line = $this->e(\str_replace($this->hidePath, '...', $line));
$line = $this->e(\str_replace($this->hidePath, '...', $line));
echo "<li>{$line}</li>"; echo "<li>{$line}</li>";
} }

View file

@ -37,7 +37,7 @@ class Mail
public function __construct(string $host, string $user, #[SensitiveParameter] string $pass, int $ssl, string $eol, protected Container $c) public function __construct(string $host, string $user, #[SensitiveParameter] string $pass, int $ssl, string $eol, protected Container $c)
{ {
if ('' != $host) { if ('' !== $host) {
$hp = \explode(':', $host, 2); $hp = \explode(':', $host, 2);
if ( if (
@ -103,11 +103,10 @@ class Mail
return false; return false;
} }
if (true === $strict) {
if ($strict) {
$level = $this->c->ErrorHandler->logOnly(\E_WARNING); $level = $this->c->ErrorHandler->logOnly(\E_WARNING);
if ($ip) { if (\is_string($ip)) {
$mx = \checkdnsrr($ip, 'MX'); // ipv6 в пролёте :( $mx = \checkdnsrr($ip, 'MX'); // ipv6 в пролёте :(
} else { } else {
$mx = \dns_get_record($domainASCII, \DNS_MX); $mx = \dns_get_record($domainASCII, \DNS_MX);