瀏覽代碼

Fix regression in ext.php (#8021)

fix https://github.com/FreshRSS/Extensions/issues/370
Regression from https://github.com/FreshRSS/FreshRSS/pull/7857
Alexandre Alapetite 8 月之前
父節點
當前提交
3a795eb5db
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      p/ext.php

+ 6 - 0
p/ext.php

@@ -91,6 +91,12 @@ if (!is_valid_path($absolute_filename)) {
 	sendBadRequestResponse('File is not supported.');
 }
 
+FreshRSS_Context::initSystem();
+if (!FreshRSS_Context::hasSystemConf()) {
+	header('HTTP/1.1 500 Internal Server Error');
+	die('Invalid system init!');
+}
+
 $content_type = FreshRSS_extension_Controller::MIME_TYPES[$file_type];
 header("Content-Type: {$content_type}");
 header("Content-Disposition: inline; filename='{$file_name}'");