diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2023-02-17 13:13:16 +0000 |
|---|---|---|
| committer | David Siegfried <david.siegfried@uni-vechta.de> | 2023-02-17 13:13:16 +0000 |
| commit | 649486b2f6cafaac9215452558a713ce1aacb73a (patch) | |
| tree | b237e96f1bb5171676f71947ea6f066b3a4dac87 /app/controllers/file.php | |
| parent | 2933487cef692c238a50863ed8933ffd57972234 (diff) | |
ensure variable from_plugin is set, fixes #2185
Closes #2185
Merge request studip/studip!1411
Diffstat (limited to 'app/controllers/file.php')
| -rw-r--r-- | app/controllers/file.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/app/controllers/file.php b/app/controllers/file.php index c53a219..e7378aa 100644 --- a/app/controllers/file.php +++ b/app/controllers/file.php @@ -253,17 +253,17 @@ class FileController extends AuthenticatedController { $this->include_navigation = Request::get('file_navigation', false); //check if the file area object is a FileRef: - if (Request::get("from_plugin")) { + $this->from_plugin = Request::get("from_plugin"); + if ($this->from_plugin) { $file_id = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], "dispatch.php/file/details/") + strlen("dispatch.php/file/details/")); if (strpos($file_id, "?") !== false) { $file_id = substr($file_id, 0, strpos($file_id, "?")); } - $plugin = PluginManager::getInstance()->getPlugin(Request::get("from_plugin")); + $plugin = PluginManager::getInstance()->getPlugin($this->from_plugin); if (!$plugin) { throw new Trails_Exception(404, _('Plugin existiert nicht.')); } $this->file = $plugin->getPreparedFile($file_id); - $this->from_plugin = Request::get("from_plugin"); } else { $file_ref = FileRef::find($file_area_object_id); if ($file_ref) { @@ -320,7 +320,7 @@ class FileController extends AuthenticatedController $this->render_action('file_details'); } else { //file area object is not a FileRef: maybe it's a folder: - if (Request::get("from_plugin")) { + if ($this->from_plugin) { $this->folder = $plugin->getFolder($file_id); } else { $this->folder = FileManager::getTypedFolder($file_area_object_id); |
