Compare commits
5
Commits
v0.17
...
d504f1d5bb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d504f1d5bb
|
||
|
|
5534f10cee
|
||
|
|
c1fe1bb0e0
|
||
|
|
ee7d9623a3
|
||
|
|
ecec258a64
|
No files matched your search
@@ -44,8 +44,10 @@ class Mail
|
||||
if (!empty($_ENV['MAIL_HOST'])) {
|
||||
$mailer->Mailer = 'smtp';
|
||||
$mailer->Host = $_ENV['MAIL_HOST'];
|
||||
$mailer->Port = !empty($_ENV['MAIL_PORT']) ? $_ENV['MAIL_PORT'] : 25;
|
||||
$mailer->SMTPSecure = !empty($_ENV['MAIL_SECURE']) ? $_ENV['MAIL_SECURE'] : '';
|
||||
$mailer->Port = !empty($_ENV['MAIL_PORT']) ? $_ENV['MAIL_PORT'] : 587;
|
||||
|
||||
$secureMaping = ['none' => '', 'starttls' => PHPMailer::ENCRYPTION_STARTTLS, 'smtps' => PHPMailer::ENCRYPTION_SMTPS];
|
||||
$mailer->SMTPSecure = !empty($_ENV['MAIL_SECURE']) ? $secureMaping[$_ENV['MAIL_SECURE']] : '';
|
||||
|
||||
if (!empty($_ENV['MAIL_USER'])) {
|
||||
$mailer->SMTPAuth = true;
|
||||
|
||||
@@ -168,7 +168,10 @@ class HttpResponse
|
||||
private function redirectToLogin(): void
|
||||
{
|
||||
$this->request->session()->set('redirect_after_login', $this->rawUrl);
|
||||
$response = new Redirect($this->routeCollection->getRoute($this->appConfig['loginRouteId'])->generateLink(), IRedirect::TEMPORARY);
|
||||
$response = new Redirect(
|
||||
$this->routeCollection->getRoute($this->appConfig['loginRouteId'])
|
||||
->generateLink(['redirect_after_login' => $this->rawUrl]),
|
||||
IRedirect::TEMPORARY);
|
||||
header('Location: ' . $this->getRedirectUrl($response), true, $response->getHttpCode());
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ class Route implements IRoute
|
||||
foreach ($this->pattern as $fragment) {
|
||||
if (preg_match('/^{(\\w+)(\\?)?}$/', $fragment, $matches) === 1) {
|
||||
if (isset($parameters[$matches[1]])) {
|
||||
$link[] = $parameters[$matches[1]];
|
||||
$link[] = rawurlencode($parameters[$matches[1]]);
|
||||
unset($parameters[$matches[1]]);
|
||||
} elseif (!isset($matches[2])) {//TODO: why? parameter not found but not optional
|
||||
$link[] = $fragment;
|
||||
@@ -53,7 +53,7 @@ class Route implements IRoute
|
||||
$queryParams[$key] = $value;
|
||||
}
|
||||
|
||||
$query = count($queryParams) > 0 ? '?' . http_build_query($queryParams) : '';
|
||||
$query = count($queryParams) > 0 ? '?' . http_build_query($queryParams, encoding_type: PHP_QUERY_RFC3986) : '';
|
||||
|
||||
return '/' . implode('/', $link) . $query;
|
||||
}
|
||||
@@ -64,7 +64,7 @@ class Route implements IRoute
|
||||
|
||||
foreach ($path as $i => $fragment) {
|
||||
if (preg_match('/^{(\\w+)(?:\\?)?}$/', $this->pattern[$i], $matches) === 1) {
|
||||
$parameters[$matches[1]] = $fragment;
|
||||
$parameters[$matches[1]] = rawurldecode($fragment);
|
||||
} elseif ($fragment != $this->pattern[$i]) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user