octobercms/october · error · ApplicationException
backend::lang.partial.invalid_name
Error message
backend::lang.partial.invalid_name
What it means
Thrown by makePartialForAjax when the requested partial name fails a sanity regex (no double slashes, only alphanumerics, underscores, hyphens and single slashes). It is a generic name-format guard against path traversal / malformed partial names supplied in an AJAX request; the offending value is the $partial argument.
Solutions
- Sanitize the partial name before calling makePartialForAjax: strip invalid characters and double slashes
- Never pass raw user input (request/post data) as a partial name; map allowed names through a whitelist
- Fix the caller to use a simple snake-case partial name without traversal sequences
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at modules/backend/classes/Controller.php:462 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21).
Data as JSON: /api/errors/ecb3ea764ec05786.
Report an issue: GitHub.
Appendix: source
Thrown at modules/backend/classes/Controller.php:462
public function getAjaxHandler()
{
$request = $this->getAjaxRequest();
if ($request->hasAjaxHandler()) {
return $request->qualifiedHandler;
}
return null;
}
/**
* makePartialForAjax proxies to makePartial
* @see \Larajax\Traits\AjaxController
*/
protected function makePartialForAjax($partial)
{
if (!preg_match('/^(?!.*\/\/)[a-z0-9\_][a-z0-9\_\-\/]*$/i', $partial)) {
throw new ApplicationException(Lang::get('backend::lang.partial.invalid_name', ['name'=>e($partial)]));
}
return $this->makePartial($partial);
}
/**
* makeCallForAjax proxies to makeCallMethod
* @see \Larajax\Traits\AjaxController
*/
protected function makeCallForAjax($callable, $parameters)
{
[$instance, $method] = $callable;
if ($instance instanceof \Backend\Classes\WidgetBase) {
$this->addViewPath($instance->getViewPaths());
$result = $this->makeCallMethod($instance, $method, $parameters);
View on GitHub (pinned to b608633a7e)