- Patch-/Minor-Updates (guzzle, commonmark, flysystem, excel, phpspreadsheet, phpseclib, laravel/framework 11.x) - barryvdh/laravel-dompdf 3.1 (dompdf 3.1.6), Test fuer den PDF-Weg inkl. eingebettetem PHP und Briefpapier - Rueckport des Laravel-12.60-Fixes gegen CRLF in der email-Regel - Protokoll: Ergebnis composer audit, offene Punkte Laravel 12 und PDF-Seitenzahlen Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
30 lines
916 B
PHP
30 lines
916 B
PHP
<?php
|
|
|
|
namespace App\Support\Validation;
|
|
|
|
use Illuminate\Validation\Validator as BaseValidator;
|
|
|
|
/**
|
|
* Rückportierter Sicherheitsfix aus Laravel 12.60 (GHSA-5vg9-5847-vvmq):
|
|
* Die email-Regel lässt in Laravel 11 Zeilenumbrüche zu, über die sich
|
|
* Mail-Header einschleusen lassen. Nach dem Update auf Laravel 12 entfernen
|
|
* (samt Registrierung in AppServiceProvider).
|
|
*/
|
|
class Validator extends BaseValidator
|
|
{
|
|
/**
|
|
* @param string $attribute
|
|
* @param mixed $value
|
|
* @param array<int, string> $parameters
|
|
*/
|
|
public function validateEmail($attribute, $value, $parameters): bool
|
|
{
|
|
if (is_string($value) || (is_object($value) && method_exists($value, '__toString'))) {
|
|
if (preg_match('/[\r\n]/', (string) $value) > 0) {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return parent::validateEmail($attribute, $value, $parameters);
|
|
}
|
|
}
|