Stand: SMTP-Test, Admin-Mail-Tab, Notifiable-Fix, Lazy-Quill
- Fix: Notifiable-Trait zum User-Model hinzugefuegt (behebt notify()-500er) - Installer: SMTP-Verbindungstest mit EsmtpTransport + Ueberspringen-Link - Admin: Neuer E-Mail-Tab mit SMTP-Konfiguration + Verbindungstest - Admin: Lazy Quill-Initialisierung (nur sichtbare Locale wird geladen) - Uebersetzungen: 17 neue Mail-Keys in allen 6 Sprachen Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
49
vendor/league/flysystem/src/WhitespacePathNormalizer.php
vendored
Executable file
49
vendor/league/flysystem/src/WhitespacePathNormalizer.php
vendored
Executable file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace League\Flysystem;
|
||||
|
||||
class WhitespacePathNormalizer implements PathNormalizer
|
||||
{
|
||||
public function normalizePath(string $path): string
|
||||
{
|
||||
$path = str_replace('\\', '/', $path);
|
||||
$this->rejectFunkyWhiteSpace($path);
|
||||
|
||||
return $this->normalizeRelativePath($path);
|
||||
}
|
||||
|
||||
private function rejectFunkyWhiteSpace(string $path): void
|
||||
{
|
||||
if (preg_match('#\p{C}+#u', $path)) {
|
||||
throw CorruptedPathDetected::forPath($path);
|
||||
}
|
||||
}
|
||||
|
||||
private function normalizeRelativePath(string $path): string
|
||||
{
|
||||
$parts = [];
|
||||
|
||||
foreach (explode('/', $path) as $part) {
|
||||
switch ($part) {
|
||||
case '':
|
||||
case '.':
|
||||
break;
|
||||
|
||||
case '..':
|
||||
if (empty($parts)) {
|
||||
throw PathTraversalDetected::forPath($path);
|
||||
}
|
||||
array_pop($parts);
|
||||
break;
|
||||
|
||||
default:
|
||||
$parts[] = $part;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return implode('/', $parts);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user