
Ron Appleton
Some test subscription campaing.
protected function cleanResponseContent(string $content): string
{
$cleaned = preg_replace('/[^\P{C}\n]+/u', '', $content);
if (!mb_check_encoding($cleaned, 'UTF-8')) {
return '[invalid response content removed]';
}
// Set a limit close to 1MB (1,000,000 bytes)
$maxLength = 1_000_000;
return strlen($cleaned ?? '') > $maxLength
? mb_substr($cleaned, 0, $maxLength) . '... [truncated]'
: $cleaned ?? '';
}
About

Ron Appleton
Ron Appleton
protected function cleanResponseContent(string $content): string { $cleaned = preg_replace('/[^\P{C}\n]+/u', '', $content); if (!mb_check_encoding($cleaned, 'UTF-8')) { return '[invalid response content removed]'; } // Set a limit close to 1MB (1,000,000 bytes) $maxLength = 1_000_000; return strlen($cleaned ?? '') > $maxLength ? mb_substr($cleaned, 0, $maxLength) . '... [truncated]' : $cleaned ?? ''; }
Teir 1
ghhgggghjg