Hi,
I ran into a reproducible problem with sourceopt.formatHtml in a TYPO3 v14 project.
Problem
When sourceopt is enabled and sourceopt.formatHtml > 0, some inline SVGs cause a fatal error during HTML formatting.
The visible error is for example:
(1/1) TypeError
preg_replace(): Argument #3 ($subject) must be of type array|string, null given
in /app/vendor/schleuse/dindent/src/Indenter.php line 273 Copy path
}
// Restore `<script|style>` & `<!-- -->`
foreach (array_reverse($this->temporary_replacements_source, true) as $i => $original) {
$output = preg_replace('/( +)?(<[^>]+>?)?ᐄᐄᐄ' . $i . 'ᐄᐄᐄ/m', preg_replace('/^/m', '\\$1', '$2' . $original['str']) . (!empty($original['lf']) ? "\n$1" : ''), $output);
}
return rtrim($output);
}
at preg_replace('/( +)?(<[^>]+>?)?ᐄᐄᐄ3ᐄᐄᐄ/m', '$1$2$1 .st0 {$1 fill: #035aa9;$1 }$1', null)
in /app/vendor/schleuse/dindent/src/Indenter.php line 273 Copy path
}
// Restore `<script|style>` & `<!-- -->`
foreach (array_reverse($this->temporary_replacements_source, true) as $i => $original) {
$output = preg_replace('/( +)?(<[^>]+>?)?ᐄᐄᐄ' . $i . 'ᐄᐄᐄ/m', preg_replace('/^/m', '\\$1', '$2' . $original['str']) . (!empty($original['lf']) ? "\n$1" : ''), $output);
}
return rtrim($output);
}
Hi,
I ran into a reproducible problem with
sourceopt.formatHtmlin a TYPO3 v14 project.Problem
When
sourceoptis enabled andsourceopt.formatHtml > 0, some inline SVGs cause a fatal error during HTML formatting.The visible error is for example: