You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Theme Modules: Fixes and improvements after manual testing
- Added (limited) redirect handling to module downloads.
- Adjusted wording/text for consistency and clarity.
- Fixed scenarios where process was not stopped on error.
- Fixed module folder creation check/logic.
- Added better failed request handling to module downloads.
- Updated download response streaming to monitor/limit download size.
$this->error("ERROR: Module ZIP file is too large. Maximum size is 50MB");
243
+
return'';
244
+
}
245
+
}
197
246
198
247
fclose($fileHandle);
199
248
@@ -212,16 +261,16 @@ protected function getPathToZip(string $location): string|null
212
261
if ($isRemote) {
213
262
// Warning about fetching from source
214
263
$host = parse_url($location, PHP_URL_HOST);
215
-
$this->warn("This will download a module from {$host}. Modules can contain code which would have the ability to do anything on the BookStack host server.");
264
+
$this->warn("This will download a module from {$host}. Modules can contain code which would have the ability to do anything on the BookStack host server.\nYou should only install modules from trusted sources.");
216
265
$trustHost = $this->confirm('Are you sure you trust this source?');
217
266
if (!$trustHost) {
218
267
returnnull;
219
268
}
220
269
221
270
// Check if the connection is http. If so, warn the user.
222
271
if (str_starts_with($lowerLocation, 'http://')) {
223
-
$this->warn('You are downloading a module from an insecure HTTP source. We recommend using HTTPS sources.');
224
-
if (!$this->confirm('Do you wish to continue?')) {
272
+
$this->warn("You are downloading a module from an insecure HTTP source.\nWe recommend only using HTTPS sources to avoid various security risks.");
273
+
if (!$this->confirm('Are you sure you want to continue without HTTPS?')) {
0 commit comments