mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-16 04:56:34 +00:00
Consistent regexp escaping
This commit is contained in:
@@ -8,7 +8,7 @@ use PhpOffice\PhpSpreadsheet\Writer\Pdf\Tcpdf;
|
||||
function replaceBody(string $html): string
|
||||
{
|
||||
$lorem = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';
|
||||
$bodystring = '@<body>.*</body>@ms';
|
||||
$bodystring = '~<body>.*</body>~ms';
|
||||
$bodyrepl = <<<EOF
|
||||
<body>
|
||||
<h1>Serif</h1>
|
||||
|
||||
@@ -20,7 +20,7 @@ body {
|
||||
|
||||
EOF;
|
||||
|
||||
return preg_replace('@</head>@', "$newstyle</head>", $html);
|
||||
return preg_replace('~</head>~', "$newstyle</head>", $html);
|
||||
}
|
||||
|
||||
public function testSetAndReset(): void
|
||||
|
||||
Reference in New Issue
Block a user