18 new RecursiveDirectoryIterator(
$moduleRoot, FilesystemIterator::SKIP_DOTS)
22 if (!
$file->isFile() || strtolower(
$file->getExtension()) !==
'htm') {
26 $path = str_replace(
'\\',
'/',
$file->getPathname());
27 $relativePath =
'/' . ltrim(str_replace(
32 if (strpos($relativePath,
'/vendor/') !==
false
33 || strpos($relativePath,
'/add_ons/') !==
false
34 || strpos($relativePath,
'/work/') !==
false) {
37 if (strpos($path,
'/modules/dbx/tpl/htm/frame-report-head.htm') !==
false
38 || strpos($path,
'/modules/dbx/tpl/htm/frame-report-foot.htm') !==
false) {
43 $html = (string)file_get_contents(
$file->getPathname());
44 $html = (string)preg_replace(
'/<!--.*?-->/s',
'',
$html);
45 if (!preg_match(
'/<\/?form\b/i',
$html)) {
50 preg_match_all(
'/<\/?form\b[^>]*>/i',
$html, $matches);
52 foreach ($matches[0] as $tag) {
53 if (preg_match(
'/^<\s*\/form\b/i', $tag)) {
56 $errors[] = $path .
': schließendes </form> ohne Öffnung';
64 $errors[] = $path .
': verschachteltes <form>';
68 $errors[] = $path .
': Form-Tags sind nicht ausgeglichen';
73 'dbxAdmin/tpl/htm/fdedit-create-from-dd.htm',
74 'dbxContent_admin/tpl/htm/cms-media-upload-form.htm',
75 'dbxContent_admin/tpl/htm/cms-external-video-form.htm',
76 'dbxKi/tpl/htm/ki-briefing-page-create.htm',
77 'dbxKi/tpl/htm/ki-briefing-page-update.htm',
78 'dbxKi/tpl/htm/ki-briefing-page-translation.htm',
79 'dbxKi/tpl/htm/ki-bundle-start.htm',
80 'dbxKi/tpl/htm/ki-module-briefing.htm',
81 'dbxKi/tpl/htm/ki-module-bundle-import.htm',
82 'dbxKi/tpl/htm/ki-translation-sync-all.htm',
83 'dbxShop_admin/tpl/htm/shop-product-channel-mapping.htm',
84 'dbxShop/tpl/htm/shop-cart-report.htm',
85 'dbxShop/tpl/htm/shop-checkout-form.htm',
86 'dbxShop/tpl/htm/shop-withdrawal-form.htm',
87 'dbxWorkflow/tpl/htm/workflow-review.htm',
88 'dbxWorkflow/tpl/htm/workflow-step-choice.htm',
89 'dbxWorkflow_admin/tpl/htm/workflow-bind-generator.htm',
93 $path =
$moduleRoot . DIRECTORY_SEPARATOR . str_replace(
'/', DIRECTORY_SEPARATOR, $relative);
94 $html = is_file($path) ? (string)file_get_contents($path) :
'';
96 $errors[] = $relative .
': Template fehlt';
99 if (strpos(
$html,
'[dbx:form]') ===
false) {
100 $errors[] = $relative .
': [dbx:form] für Security-/Restfelder fehlt';
105 'dbxAdmin/tpl/htm/fdedit-create-from-dd.htm',
106 'dbxShop_admin/tpl/htm/shop-product-channel-mapping.htm',
107 'dbxShop/tpl/htm/shop-checkout-form.htm',
108 'dbxShop/tpl/htm/shop-withdrawal-form.htm',
110 $path =
$moduleRoot . DIRECTORY_SEPARATOR . str_replace(
'/', DIRECTORY_SEPARATOR, $relative);
111 $html = is_file($path) ? (string)file_get_contents($path) :
'';
112 if (strpos(
$html,
'{obj:form_msg}') ===
false) {
113 $errors[] = $relative .
': zentraler dbxForm-Meldungsplatz fehlt';
118 . DIRECTORY_SEPARATOR .
'dbxShopService.class.php';
121 '$cartReport->submit()' =>
'Warenkorb-Report',
122 '$buyForm->submit()' =>
'Add-to-cart-Formular',
123 '$row = $this->repo()->saveWithdrawal($values)' =>
'Widerrufsformular',
124 'if ($form->submit())' =>
'dbxForm-Submit',
125) as $needle => $label) {
127 $errors[] =
'dbxShopService: Token-Guard fehlt für ' . $label;
132 . DIRECTORY_SEPARATOR .
'dbxShopAdmin.class.php';
135 '$form->submit()' =>
'zentraler Karten-Token-Guard',
136 '$this->postedFormError' =>
'sichtbare Karten-Fehlermeldung',
137 '$content .= $this->shopMediaFormTemplates($this->shopMediaConfig())' =>
'Medienformulare außerhalb der Kartenform',
138) as $needle => $label) {
140 $errors[] =
'dbxShopAdmin: ' . $label .
' fehlt';
143foreach (array(
'productImagesPanel',
'productGroupImagePanel') as
$method) {
145 '/private function ' . preg_quote(
$method,
'/') .
'\b.*?(?=\n\s*private function )/s',
148 ) && strpos($methodMatch[0],
'shopMediaFormTemplates(') !==
false) {
149 $errors[] =
'dbxShopAdmin: Medienformular ist noch in ' .
$method .
' verschachtelt';
153$cmsJs = (string)file_get_contents(
$root . DIRECTORY_SEPARATOR .
'js' . DIRECTORY_SEPARATOR .
'lib'
154 . DIRECTORY_SEPARATOR .
'cms.js');
157 $errors[] =
'cms.js: Formular-Markup wird wieder in JavaScript erzeugt';
161 $moduleRoot . DIRECTORY_SEPARATOR .
'dbxEditor' . DIRECTORY_SEPARATOR .
'dbxEditor.class.php'
164 $moduleRoot . DIRECTORY_SEPARATOR .
'dbxEditor' . DIRECTORY_SEPARATOR .
'tpl'
165 . DIRECTORY_SEPARATOR .
'htm' . DIRECTORY_SEPARATOR .
'editor.htm'
168 $root . DIRECTORY_SEPARATOR .
'js' . DIRECTORY_SEPARATOR .
'lib' . DIRECTORY_SEPARATOR .
'ace.js'
171 array(
$editorClass,
"array('save', 'delete', 'rename', 'copy')",
'dbxEditor: gemeinsamer Mutations-Guard fehlt'),
172 array(
$editorClass,
'$form->submit()',
'dbxEditor: dbxForm-Submit-Prüfung fehlt'),
173 array(
$editorTemplate,
'dbx-editor-security',
'dbxEditor: Sicherheitstoken fehlt im Editor-Template'),
174 array(
$aceJs,
'function requestMutation(data)',
'ace.js: zentrale Mutationsfunktion fehlt'),
175 array(
$aceJs,
"method: 'POST'",
'ace.js: Mutationen werden nicht per POST gesendet'),
181if (strpos(
$aceJs,
'dbx_run1=delete&file=') !==
false
182 || strpos(
$aceJs,
"requestJson('?dbx_modul=dbxEditor&dbx_run1=rename") !==
false
183 || strpos(
$aceJs,
"requestJson('?dbx_modul=dbxEditor&dbx_run1=copy") !==
false) {
184 $errors[] =
'ace.js: schreibende Editor-Aktion verwendet wieder einen GET-Aufruf';
187$formClass = (string)file_get_contents(
$root . DIRECTORY_SEPARATOR .
'include' . DIRECTORY_SEPARATOR .
'dbxForm.class.php');
188if (!preg_match(
'/function get_security_data\(\).*?\$this->store_sysdata\(\)/s',
$formClass)) {
189 $errors[] =
'dbxForm: AJAX-Folgetoken wird nicht unmittelbar in der Session gespeichert';
193 $errors[] =
'Keine aktiven Formular-Templates gefunden';
197 fwrite(STDERR,
"Formular-Strukturprüfung fehlgeschlagen:\n - " . implode(
"\n - ", array_unique(
$errors)) .
"\n");
201echo
"OK: {$checked} Formular-Templates sind ausgeglichen, nicht verschachtelt und die migrierten Formulare sind abgesichert.\n";