Nimm die Rueckkehr aus dem Modul auch bei einer vollstaendigen Adresse an.
Deploy Test / test (push) Successful in 21s
Deploy Test / deploy (push) Successful in 22s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-11-16 14:10:14 +01:00
1 parent a7feef2cd2
commit 42415dff51
3 files changed
+12 -5

No files matched your search

@@ -186,7 +186,7 @@ public function isProgram(): bool
public function selfUrl(): string
{
return static::getResource()::getUrl('edit', ['record' => $this->getRecord()]);
return $this->safeReturn(static::getResource()::getUrl('edit', ['record' => $this->getRecord()]));
}
public function previewUrl(): ?string
@@ -887,17 +887,18 @@ protected function actor(): ?User
protected function safeReturn(mixed $url): string
{
if (! is_string($url) || $url === '' || parse_url($url, PHP_URL_HOST)) {
if (! is_string($url) || $url === '') {
return '';
}
$path = parse_url($url, PHP_URL_PATH);
$parts = parse_url($url);
$path = is_array($parts) ? ($parts['path'] ?? '') : '';
if (! is_string($path) || ! str_starts_with($path, '/verwaltung/') || str_contains($path, '..')) {
return '';
}
$query = parse_url($url, PHP_URL_QUERY);
$query = is_array($parts) ? ($parts['query'] ?? '') : '';
return $path.(is_string($query) && $query !== '' ? '?'.$query : '');
}