File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 33 "description" : " Sidworks Developer tools for Shopware 6" ,
44 "type" : " shopware-platform-plugin" ,
55 "license" : " MIT" ,
6- "version" : " 1.0.1 " ,
6+ "version" : " 1.0.2 " ,
77 "authors" : [
88 {
99 "name" : " Sidworks"
1010 }
1111 ],
1212 "require" : {
13- "shopware/core" : " ^ 6.6"
13+ "shopware/core" : " ~ 6.6.0 || ~6.7.0 "
1414 },
1515 "autoload" : {
1616 "psr-4" : {
2020 "extra" : {
2121 "shopware-plugin-class" : " Sidworks\\ DevTools\\ SidworksDevTools" ,
2222 "label" : {
23- "en-GB" : " Sidworks Developer Tools"
23+ "en-GB" : " Sidworks Developer Tools" ,
24+ "de-DE" : " Sidworks Entwicklerwerkzeuge"
2425 },
2526 "description" : {
26- "en-GB" : " Developer tools to inspect HTML elements and identify their source Twig templates"
27+ "en-GB" : " Developer tools to inspect HTML elements and identify their source Twig templates" ,
28+ "de-DE" : " Entwicklerwerkzeuge zum Untersuchen von HTML Elementen und zum Identifizieren der zugehörigen Twig Vorlagen"
2729 }
2830 }
2931}
Original file line number Diff line number Diff line change @@ -90,7 +90,7 @@ private function removeCommentsFromAttributes(string $content): string
9090 {
9191 // Simple approach: find all attribute values (text between ="" quotes)
9292 // and remove SWDT comments from them
93- return preg_replace_callback (
93+ $ result = preg_replace_callback (
9494 '/(\w+)="((?:[^" \\\\]| \\\\.)*)"/s ' ,
9595 function ($ matches ) {
9696 $ attrName = $ matches [1 ];
@@ -107,6 +107,9 @@ function ($matches) {
107107 },
108108 $ content
109109 );
110+
111+ // Return original content if preg_replace_callback failed (returns null on error)
112+ return $ result ?? $ content ;
110113 }
111114
112115 /**
@@ -122,7 +125,7 @@ private function removeCommentsFromSpecialTags(string $content): string
122125 foreach ($ specialTags as $ tag ) {
123126 // Match opening tag, content, and closing tag
124127 // Use backreference \1 to match the same tag name in closing tag
125- $ content = preg_replace_callback (
128+ $ result = preg_replace_callback (
126129 '/<( ' . $ tag . ')([^>]*)>(.*?)<\/\1>/si ' ,
127130 function ($ matches ) {
128131 $ tag = $ matches [1 ];
@@ -144,6 +147,9 @@ function ($matches) {
144147 },
145148 $ content
146149 );
150+
151+ // Keep original content if preg_replace_callback failed (returns null on error)
152+ $ content = $ result ?? $ content ;
147153 }
148154
149155 return $ content ;
You can’t perform that action at this time.
0 commit comments