Consistent regexp escaping
This commit is contained in:
parent
360c8d8284
commit
2896e6ceb9
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue