1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-10 08:44:46 +02:00
This commit is contained in:
Ryan Cramer
2023-07-21 11:47:10 -04:00
parent 4c6c2b7c89
commit cdba83f115

View File

@@ -343,7 +343,18 @@ class ProcessController extends Wire {
if(!$method) {
throw new ProcessController404Exception("Unrecognized path");
}
if($method === 'executeNavJSON' && !$this->wire()->config->ajax && !$debug) {
// disallow navJSON output when not ajax and not debug mode
if(!$this->wire()->user->isLoggedin()) wire404();
$navJSON = substr($this->wire()->input->url(), -8);
if($navJSON === 'navJSON/') {
$this->wire()->session->location('../');
} else if($navJSON === '/navJSON') {
$this->wire()->session->location('./');
}
}
// call method from Process (and time it if debug mode enabled)
$className = $process->className();
if($debug) Debug::timer("$className.$method()");
@@ -500,6 +511,3 @@ class ProcessController extends Wire {
}
}