create-prisma-php-app 3.1.18 → 3.1.19

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.
@@ -110,8 +110,8 @@ class MainLayout
110
110
  $attrs = $m[1];
111
111
  $encodedClass = 's' . base_convert(sprintf('%u', crc32($rawClassName)), 10, 36);
112
112
 
113
- if (!str_contains($attrs, 'pp-sync-script=')) {
114
- $attrs .= " pp-sync-script=\"{$encodedClass}\"";
113
+ if (!str_contains($attrs, 'pp-component=')) {
114
+ $attrs .= " pp-component=\"{$encodedClass}\"";
115
115
  }
116
116
 
117
117
  if (!preg_match('/\btype\s*=\s*(["\'])[^\1]*\1|\btype\s*=\s*\S+/i', $attrs)) {
@@ -209,11 +209,24 @@ class TemplateCompiler
209
209
  return $m[0];
210
210
  }
211
211
 
212
- if (strpos($m[2], '<![CDATA[') !== false) {
212
+ if (str_contains($m[2], '<![CDATA[')) {
213
213
  return $m[0];
214
214
  }
215
215
 
216
- if (preg_match('/\btype\s*=\s*(["\']?)(?!text\/|application\/javascript|module)/i', $m[1])) {
216
+ $type = '';
217
+ if (preg_match('/\btype\s*=\s*([\'"]?)([^\'"\s>]+)/i', $m[1], $t)) {
218
+ $type = strtolower($t[2]);
219
+ }
220
+
221
+ $codeTypes = [
222
+ '',
223
+ 'text/javascript',
224
+ 'application/javascript',
225
+ 'module',
226
+ 'text/php',
227
+ ];
228
+
229
+ if (!in_array($type, $codeTypes, true)) {
217
230
  return $m[0];
218
231
  }
219
232
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-prisma-php-app",
3
- "version": "3.1.18",
3
+ "version": "3.1.19",
4
4
  "description": "Prisma-PHP: A Revolutionary Library Bridging PHP with Prisma ORM",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",