Passed
Pull Request — developer (#15265)
by Arkadiusz
20:15
created
modules/Settings/ConfigEditor/models/Module.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -142,7 +142,7 @@
 block discarded – undo
142 142
 	public function getFieldInstanceByName($name)
143 143
 	{
144 144
 		$moduleName = $this->getName(true);
145
-		$params = ['uitype' => 7, 'column' => $name, 'name' => $name,  'displaytype' => 1, 'typeofdata' => 'I~M', 'presence' => 0, 'isEditableReadOnly' => false, 'maximumlength' => '', 'validator' => [['name' => 'NumberRange100']], 'source' => 'main'];
145
+		$params = ['uitype' => 7, 'column' => $name, 'name' => $name, 'displaytype' => 1, 'typeofdata' => 'I~M', 'presence' => 0, 'isEditableReadOnly' => false, 'maximumlength' => '', 'validator' => [['name' => 'NumberRange100']], 'source' => 'main'];
146 146
 		switch ($name) {
147 147
 			case 'listMaxEntriesMassEdit':
148 148
 				$params['maximumlength'] = '5000';
Please login to merge, or discard this patch.
config/ConfigTemplates.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@  discard block
 block discarded – undo
10 10
 		'enabledServices' => [
11 11
 			'default' => [],
12 12
 			'description' => 'List of active services. Available: dav, webservice',
13
-			'validation' => function () {
13
+			'validation' => function() {
14 14
 				$arg = func_get_arg(0);
15 15
 				return \is_array($arg) && empty(array_diff($arg, ['dav', 'webservice']));
16 16
 			}
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 		'AUTH_METHOD' => [
55 55
 			'default' => 'Basic',
56 56
 			'description' => 'Webservice config.',
57
-			'validation' => function () {
57
+			'validation' => function() {
58 58
 				return 'Basic' === func_get_arg(0);
59 59
 			}
60 60
 		],
@@ -102,18 +102,18 @@  discard block
 block discarded – undo
102 102
 		'upload_maxsize' => [
103 103
 			'default' => 52428800,
104 104
 			'description' => 'Maximum file size for uploaded files in bytes also used when uploading import files: upload_maxsize default value = 52428800 (50MB)',
105
-			'validation' => function () {
105
+			'validation' => function() {
106 106
 				$arg = func_get_arg(0);
107 107
 				return $arg && \App\Validator::naturalNumber($arg) && ($arg * 1048576) <= \vtlib\Functions::getMaxUploadSize();
108 108
 			},
109
-			'sanitization' => function () {
109
+			'sanitization' => function() {
110 110
 				return (int) func_get_arg(0) * 1048576;
111 111
 			}
112 112
 		],
113 113
 		'allow_exports' => [
114 114
 			'default' => 'all',
115 115
 			'description' => 'Flag to allow export functionality: "all" - to allow anyone to use exports, "admin" - to only allow admins to export, "none" -  to block exports completely',
116
-			'validation' => function () {
116
+			'validation' => function() {
117 117
 				$arg = func_get_arg(0);
118 118
 				return \in_array($arg, ['all', 'admin', 'none']);
119 119
 			}
@@ -125,18 +125,18 @@  discard block
 block discarded – undo
125 125
 		'list_max_entries_per_page' => [
126 126
 			'default' => 20,
127 127
 			'description' => 'List max entries per page: default value = 20',
128
-			'validation' => function () {
128
+			'validation' => function() {
129 129
 				$arg = func_get_arg(0);
130 130
 				return $arg && \App\Validator::naturalNumber($arg) && (100 >= $arg) && (0 < $arg);
131 131
 			},
132
-			'sanitization' => function () {
132
+			'sanitization' => function() {
133 133
 				return (int) func_get_arg(0);
134 134
 			}
135 135
 		],
136 136
 		'default_module' => [
137 137
 			'default' => 'Home',
138 138
 			'description' => 'Default module: default value = Home',
139
-			'validation' => function () {
139
+			'validation' => function() {
140 140
 				$arg = func_get_arg(0);
141 141
 				return true === \App\Module::isModuleActive($arg);
142 142
 			}
@@ -144,7 +144,7 @@  discard block
 block discarded – undo
144 144
 		'default_charset' => [
145 145
 			'default' => 'UTF-8',
146 146
 			'description' => 'Default charset:  default value = "UTF-8"',
147
-			'validation' => function () {
147
+			'validation' => function() {
148 148
 				return 'UTF-8' === func_get_arg(0);
149 149
 			}
150 150
 		],
@@ -156,21 +156,21 @@  discard block
 block discarded – undo
156 156
 		'application_unique_key' => [
157 157
 			'default' => sha1(time() + random_int(1, 9999999)),
158 158
 			'description' => 'Unique Application Key',
159
-			'validation' => function () {
159
+			'validation' => function() {
160 160
 				return !class_exists('\\Config\\Main');
161 161
 			},
162
-			'sanitization' => function () {
162
+			'sanitization' => function() {
163 163
 				return sha1(time() + random_int(1, 9999999));
164 164
 			}
165 165
 		],
166 166
 		'listview_max_textlength' => [
167 167
 			'default' => 40,
168 168
 			'description' => 'Trim descriptions, titles in listviews to this value',
169
-			'validation' => function () {
169
+			'validation' => function() {
170 170
 				$arg = func_get_arg(0);
171 171
 				return $arg && \App\Validator::naturalNumber($arg) && (100 >= $arg) && (0 < $arg);
172 172
 			},
173
-			'sanitization' => function () {
173
+			'sanitization' => function() {
174 174
 				return (int) func_get_arg(0);
175 175
 			}
176 176
 		],
@@ -181,7 +181,7 @@  discard block
 block discarded – undo
181 181
 		'default_timezone' => [
182 182
 			'default' => '_TIMEZONE_',
183 183
 			'description' => 'Set the default timezone as per your preference',
184
-			'validation' => function () {
184
+			'validation' => function() {
185 185
 				$arg = func_get_arg(0);
186 186
 				return \in_array($arg, timezone_identifiers_list());
187 187
 			}
@@ -189,33 +189,33 @@  discard block
 block discarded – undo
189 189
 		'title_max_length' => [
190 190
 			'default' => 60,
191 191
 			'description' => 'Maximum length of characters for title',
192
-			'validation' => function () {
192
+			'validation' => function() {
193 193
 				$arg = func_get_arg(0);
194 194
 				return $arg && \App\Validator::naturalNumber($arg) && (100 >= $arg) && (0 < $arg);
195 195
 			},
196
-			'sanitization' => function () {
196
+			'sanitization' => function() {
197 197
 				return (int) func_get_arg(0);
198 198
 			}
199 199
 		],
200 200
 		'href_max_length' => [
201 201
 			'default' => 35,
202 202
 			'description' => 'Maximum length for href tag',
203
-			'validation' => function () {
203
+			'validation' => function() {
204 204
 				$arg = func_get_arg(0);
205 205
 				return $arg && \App\Validator::naturalNumber($arg) && (100 >= $arg) && (0 < $arg);
206 206
 			},
207
-			'sanitization' => function () {
207
+			'sanitization' => function() {
208 208
 				return (int) func_get_arg(0);
209 209
 			}
210 210
 		],
211 211
 		'MINIMUM_CRON_FREQUENCY' => [
212 212
 			'default' => 1,
213 213
 			'description' => 'Minimum cron frequency [min]',
214
-			'validation' => function () {
214
+			'validation' => function() {
215 215
 				$arg = func_get_arg(0);
216 216
 				return $arg && \App\Validator::naturalNumber($arg) && (100 >= $arg) && (0 < $arg);
217 217
 			},
218
-			'sanitization' => function () {
218
+			'sanitization' => function() {
219 219
 				return (int) func_get_arg(0);
220 220
 			}
221 221
 		],
@@ -231,11 +231,11 @@  discard block
 block discarded – undo
231 231
 		'listMaxEntriesMassEdit' => [
232 232
 			'default' => 500,
233 233
 			'description' => 'Maximum number of records in a mass edition',
234
-			'validation' => function () {
234
+			'validation' => function() {
235 235
 				$arg = func_get_arg(0);
236 236
 				return $arg && \App\Validator::naturalNumber($arg) && (5000 >= $arg);
237 237
 			},
238
-			'sanitization' => function () {
238
+			'sanitization' => function() {
239 239
 				return (int) func_get_arg(0);
240 240
 			}
241 241
 		],
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 		'defaultLayout' => [
279 279
 			'default' => 'basic',
280 280
 			'description' => 'Set the default layout',
281
-			'validation' => function () {
281
+			'validation' => function() {
282 282
 				return isset(\App\Layout::getAllLayouts()[func_get_arg(0)]);
283 283
 			}
284 284
 		],
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 		'phoneFieldAdvancedHrefFormat' => [
290 290
 			'default' => new \Nette\PhpGenerator\PhpLiteral('\libphonenumber\PhoneNumberFormat::RFC3966'),
291 291
 			'description' => "Phone number display format. Values:\nfalse - formatting is disabled \n\\libphonenumber\\PhoneNumberFormat::RFC3966 - +48-44-668-18-00\n\\libphonenumber\\PhoneNumberFormat::E164 - +48446681800 \n\\libphonenumber\\PhoneNumberFormat::INTERNATIONAL - 044 668 18 00\n\\libphonenumber\\PhoneNumberFormat::NATIONAL - +48 44 668 18 00",
292
-			'validation' => function () {
292
+			'validation' => function() {
293 293
 				return \in_array(func_get_arg(0), [
294 294
 					false,
295 295
 					\libphonenumber\PhoneNumberFormat::RFC3966,
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 		'LOG_LEVELS' => [
349 349
 			'default' => false,
350 350
 			'description' => 'Level of saved/displayed logs. Values: false = All / 3 = error and warning / ["error", "warning", "info", "trace", "profile"]',
351
-			'validation' => function () {
351
+			'validation' => function() {
352 352
 				$arg = func_get_arg(0);
353 353
 				return false === $arg || (\is_array($arg) && array_diff(['error', 'warning', 'info', 'trace', 'profile'], $arg));
354 354
 			},
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
 		'SMARTY_ERROR_REPORTING' => [
430 430
 			'default' => new \Nette\PhpGenerator\PhpLiteral('E_ALL & ~E_NOTICE'),
431 431
 			'description' => 'Do not show Smarty Notice in phpError.log',
432
-			'validation' => function () {
432
+			'validation' => function() {
433 433
 				$arg = (string) func_get_arg(0);
434 434
 				return \in_array($arg, ['E_ALL', 'E_ALL & ~E_NOTICE']);
435 435
 			},
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
 		'EXCEPTION_ERROR_LEVEL' => [
438 438
 			'default' => new \Nette\PhpGenerator\PhpLiteral('E_ALL & ~E_NOTICE'),
439 439
 			'description' => "Set the error reporting level. The parameter is either an integer representing a bit field, or named constants.\nhttps://secure.php.net/manual/en/errorfunc.configuration.php#ini.error-reporting\nAll errors - E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED / Critical errors - E_ERROR | E_WARNING | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR",
440
-			'validation' => function () {
440
+			'validation' => function() {
441 441
 				$arg = (string) func_get_arg(0);
442 442
 				return \in_array($arg, ['E_ALL', 'E_ALL & ~E_NOTICE']);
443 443
 			},
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
 		'CACHING_DRIVER' => [
606 606
 			'default' => 'Base',
607 607
 			'description' => 'Data caching is about storing some PHP variables in cache and retrieving it later from cache. Drivers: Base, Apcu',
608
-			'validation' => function () {
608
+			'validation' => function() {
609 609
 				$arg = func_get_arg(0);
610 610
 				return 'Basic' === $arg || 'Apcu' === $arg;
611 611
 			}
@@ -808,7 +808,7 @@  discard block
 block discarded – undo
808 808
 		'MODULES_SPLITTED_EDIT_VIEW_LAYOUT' => [
809 809
 			'default' => [],
810 810
 			'description' => 'List of modules with splitted edit view layout',
811
-			'validation' => function () {
811
+			'validation' => function() {
812 812
 				$arg = func_get_arg(0);
813 813
 				return \is_array($arg) && array_diff($arg, App\Module::getAllModuleNames());
814 814
 			}
@@ -859,7 +859,7 @@  discard block
 block discarded – undo
859 859
 			'default' => 20,
860 860
 			'description' => 'Maximum length of a comment visible in the related module',
861 861
 			'validation' => '\App\Validator::naturalNumber',
862
-			'sanitization' => function () {
862
+			'sanitization' => function() {
863 863
 				return (int) func_get_arg(0);
864 864
 			}
865 865
 		],
@@ -909,7 +909,7 @@  discard block
 block discarded – undo
909 909
 		'GLOBAL_SEARCH_SORTING_RESULTS' => [
910 910
 			'default' => 0,
911 911
 			'description' => 'Global search - Should the results be sorted in MySQL or PHP while displaying (None = 0, PHP = 1, Mysql = 2). The parameter impacts system efficiency.',
912
-			'validation' => function () {
912
+			'validation' => function() {
913 913
 				$arg = func_get_arg(0);
914 914
 				return \is_int($arg) && \in_array($arg, [0, 1, 2]);
915 915
 			}
@@ -923,7 +923,7 @@  discard block
 block discarded – undo
923 923
 		'GLOBAL_SEARCH_AUTOCOMPLETE' => [
924 924
 			'default' => 1,
925 925
 			'description' => 'Global search - Search for records while entering text  (1/0).',
926
-			'validation' => function () {
926
+			'validation' => function() {
927 927
 				$arg = func_get_arg(0);
928 928
 				return \is_int($arg) && \in_array($arg, [0, 1]);
929 929
 			}
@@ -957,14 +957,14 @@  discard block
 block discarded – undo
957 957
 		'encryptionPass' => [
958 958
 			'default' => 'yeti',
959 959
 			'description' => 'Key to encrypt passwords, changing the key results in the loss of all encrypted data.',
960
-			'validation' => function () {
960
+			'validation' => function() {
961 961
 				return true;
962 962
 			}
963 963
 		],
964 964
 		'encryptionMethod' => [
965 965
 			'default' => 'aes-256-cbc',
966 966
 			'description' => 'Encryption method.',
967
-			'validation' => function () {
967
+			'validation' => function() {
968 968
 				$arg = func_get_arg(0);
969 969
 				return empty($arg) || ($arg && \in_array($arg, \App\Encryption::getMethods()));
970 970
 			}
@@ -1032,7 +1032,7 @@  discard block
 block discarded – undo
1032 1032
 		'permittedModulesByCreatorField' => [
1033 1033
 			'default' => [],
1034 1034
 			'description' => 'List of modules to which access is based on the record creation.',
1035
-			'validation' => function () {
1035
+			'validation' => function() {
1036 1036
 				$arg = func_get_arg(0);
1037 1037
 				return \is_array($arg) && array_diff($arg, App\Module::getAllModuleNames());
1038 1038
 			}
@@ -1103,7 +1103,7 @@  discard block
 block discarded – undo
1103 1103
 		'cookieForceHttpOnly' => [
1104 1104
 			'default' => true,
1105 1105
 			'description' => "Force the use of https only for cookie.\nValues: true, false, null",
1106
-			'validation' => function () {
1106
+			'validation' => function() {
1107 1107
 				$arg = func_get_arg(0);
1108 1108
 				return null === $arg ? $arg : \is_bool($arg);
1109 1109
 			}
@@ -1121,7 +1121,7 @@  discard block
 block discarded – undo
1121 1121
 		'USER_AUTHY_MODE' => [
1122 1122
 			'default' => 'TOTP_OPTIONAL',
1123 1123
 			'description' => "User authentication mode.\n\n@see \\Users_Totp_Authmethod::ALLOWED_USER_AUTHY_MODE\nAvailable values:\nTOTP_OFF - 2FA TOTP is checking off\nTOTP_OPTIONAL - It is defined by the user\nTOTP_OBLIGATORY - It is obligatory.",
1124
-			'validation' => function () {
1124
+			'validation' => function() {
1125 1125
 				$arg = func_get_arg(0);
1126 1126
 				return \in_array($arg, \Users_Totp_Authmethod::ALLOWED_USER_AUTHY_MODE);
1127 1127
 			}
@@ -1299,7 +1299,7 @@  discard block
 block discarded – undo
1299 1299
 		'db_password' => [
1300 1300
 			'default' => '_DBC_PASS_',
1301 1301
 			'description' => 'Gets the database password',
1302
-			'validation' => function () {
1302
+			'validation' => function() {
1303 1303
 				return true;
1304 1304
 			}
1305 1305
 		],
Please login to merge, or discard this patch.