'https://example.com', 'secureUrl' => 'https://secure.example.com', 'publicUrl' => 'https://public.example.com', 'flexibleUrl' => 'example.com', // Wird zu https://example.com 'strictUrl' => 'https://production.example.com', ]; // ❌ Ungültige URLs $invalidExamples = [ 'website' => 'not-a-url', // Kein gültiges URL-Format 'secureUrl' => 'http://insecure.com', // Nicht HTTPS 'publicUrl' => 'https://localhost', // Lokale URL nicht erlaubt 'flexibleUrl' => 'ftp://files.com', // FTP nicht HTTP/HTTPS 'strictUrl' => 'http://localhost', // Nicht sicher UND lokal ]; /** * Die URL Validation Rule unterstützt verschiedene Konfigurationen: * * @param bool $requireSecure - Nur HTTPS URLs erlauben * @param bool $allowLocal - Lokale URLs (localhost, 192.168.x.x) erlauben * @param bool $autoAddProtocol - Automatisch https:// hinzufügen wenn fehlt * @param string|null $message - Benutzerdefinierte Fehlermeldung * * Validierungsregeln des Url Value Objects: * - Gültiges URL-Format (parse_url() erfolgreich) * - Scheme und Host erforderlich * - Unterstützte Schemes: http, https, ftp, ftps, ssh, file, data * - Host max. 253 Zeichen * - Keine ungültigen Zeichen im Host: Leerzeichen, <, >, ", ' * - Keine aufeinanderfolgenden Punkte im Host * - Host darf nicht mit Punkt oder Bindestrich beginnen/enden * - IP-Adressen werden validiert (filter_var FILTER_VALIDATE_IP) * - Ports müssen zwischen 1-65535 liegen * - Keine Leer-URLs (nur Schema ohne Host) * - Keine führenden/nachgestellten Leerzeichen * - Max. 2048 Zeichen Gesamtlänge */