@@ -46,7 +46,7 @@ public function getFields(): array
46
46
[
47
47
'type ' => 'html ' ,
48
48
'label ' => '' ,
49
- 'html_content ' => $ this ->infectedFiles (),
49
+ 'html_content ' => $ this ->render (),
50
50
'col ' => 12 ,
51
51
'name ' => '' ,
52
52
],
@@ -58,9 +58,26 @@ public function getFields(): array
58
58
];
59
59
}
60
60
61
- private function infectedFiles (): string
61
+ private function render (): string
62
62
{
63
- $ sections = [
63
+ $ result = '' ;
64
+
65
+ foreach ($ this ->getSections () as $ section ) {
66
+ if (!empty ($ section [0 ])) {
67
+ $ result .= View::displayAlertDanger ($ section [1 ] . '<br> ' . implode ('<br> ' , $ section [0 ]));
68
+ } else {
69
+ $ result .= View::displayAlertSuccess ($ section [2 ]);
70
+ }
71
+ }
72
+
73
+ $ result .= $ this ->getStyle ();
74
+
75
+ return $ result ;
76
+ }
77
+
78
+ private function getSections (): array
79
+ {
80
+ return [
64
81
[
65
82
$ this ->getPatchModules (),
66
83
$ this ->module ->l ('Your website is vulnerable. You must upgrade the following modules manually: ' , $ this ->className ),
@@ -82,20 +99,6 @@ private function infectedFiles(): string
82
99
$ this ->module ->l ('No insecure filepermissions was found. ' , $ this ->className ),
83
100
],
84
101
];
85
-
86
- $ result = '' ;
87
-
88
- foreach ($ sections as $ section ) {
89
- if (!empty ($ section [0 ])) {
90
- $ result .= View::displayAlertDanger ($ section [1 ] . '<br> ' . implode ('<br> ' , $ section [0 ]));
91
- } else {
92
- $ result .= View::displayAlertSuccess ($ section [2 ]);
93
- }
94
- }
95
-
96
- $ result .= '<style>.bootstrap, .form-horizontal, .form-wrapper{max-width: 100% !important;}</style> ' ;
97
-
98
- return $ result ;
99
102
}
100
103
101
104
/**
@@ -161,4 +164,9 @@ private function getInsecureFilepermissions(): array
161
164
->scan ()
162
165
->dryRun ();
163
166
}
167
+
168
+ private function getStyle (): string
169
+ {
170
+ return '<style>.bootstrap, .form-horizontal, .form-wrapper{max-width: 100% !important;}</style> ' ;
171
+ }
164
172
}
0 commit comments