Skip to content

Commit eccbfc0

Browse files
authored
Limit storePreviousURL to certain requests
1 parent 1ed8d36 commit eccbfc0

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

system/CodeIgniter.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
use Closure;
4141
use CodeIgniter\Filters\Exceptions\FilterException;
4242
use CodeIgniter\HTTP\DownloadResponse;
43+
use CodeIgniter\HTTP\IncomingRequest;
4344
use CodeIgniter\HTTP\RedirectResponse;
4445
use CodeIgniter\HTTP\Request;
4546
use CodeIgniter\HTTP\ResponseInterface;
@@ -968,6 +969,12 @@ protected function gatherOutput($cacheConfig = null, $returned = null)
968969
*/
969970
public function storePreviousURL($uri)
970971
{
972+
// Only valid for some requests
973+
if (! $this->request instanceof IncomingRequest || $this->request->isCLI() || $this->request->isAJAX())
974+
{
975+
return;
976+
}
977+
971978
// This is mainly needed during testing...
972979
if (is_string($uri))
973980
{

0 commit comments

Comments
 (0)