guest) { throw new \Exception('Restricted', 403); } // Reset profile_id $app->input->set('profile_id', 0); $task = $app->input->getCmd('task', ''); $ctrl = strpos($task, '.') !== false ? strstr($task, '.', true) : ''; // Hard allowlist: runs before MVC dispatch, independent of class loading and // file discovery. Only plugin and editor may be reached from the frontend. // Any other controller name — including an empty task — returns 403 here. if (!in_array($ctrl, array('plugin', 'editor'), true)) { throw new \Exception('Restricted', 403); } // constants and autoload — only reached for permitted controllers require_once JPATH_ADMINISTRATOR . '/components/com_jce/includes/base.php'; // Dispatch using the frontend controller path only. // The controller stubs in controller/ load the admin classes, which carry // their own independent security (CSRF token, profile check, task allowlist). // The fallback JceController handles anything that slips past the above gate. $controller = BaseController::getInstance('Jce', array('base_path' => JPATH_COMPONENT)); $controller->execute($task); $controller->redirect();