Fix extension test escape string for unix

This commit is contained in:
crazywhalecc 2024-07-19 22:46:40 +08:00 committed by Jerry Ma
parent 3711db1093
commit c40e41cebe

View File

@ -180,8 +180,8 @@ class Extension
if (file_exists(ROOT_DIR . '/src/globals/ext-tests/' . $this->getName() . '.php')) {
// Trim additional content & escape special characters to allow inline usage
$test = str_replace(
['<?php', 'declare(strict_types=1);', "\n", '"', '$'],
['', '', '', '\"', '\$'],
['<?php', 'declare(strict_types=1);', "\n", '"', '$', '!'],
['', '', '', '\"', '\$', '"\'!\'"'],
file_get_contents(ROOT_DIR . '/src/globals/ext-tests/' . $this->getName() . '.php')
);