create-prisma-php-app 2.4.3 → 2.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -130,9 +130,23 @@ class TemplateCompiler
|
|
|
130
130
|
);
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
+
private static function escapeMustacheAngles(string $content): string
|
|
134
|
+
{
|
|
135
|
+
return preg_replace_callback(
|
|
136
|
+
'/\{\{[\s\S]*?\}\}/u',
|
|
137
|
+
fn($m) => str_replace(['<', '>'], ['<', '>'], $m[0]),
|
|
138
|
+
$content
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
|
|
133
142
|
public static function convertToXml(string $templateContent): DOMDocument
|
|
134
143
|
{
|
|
135
|
-
$templateContent = self::
|
|
144
|
+
$templateContent = self::escapeMustacheAngles(
|
|
145
|
+
self::escapeAttributeAngles(
|
|
146
|
+
self::escapeAmpersands($templateContent)
|
|
147
|
+
)
|
|
148
|
+
);
|
|
149
|
+
|
|
136
150
|
$dom = new DOMDocument();
|
|
137
151
|
libxml_use_internal_errors(true);
|
|
138
152
|
|