Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fixes in Common.php #4192

Merged
merged 3 commits into from
Jan 30, 2021
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions system/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,18 @@
* file that was distributed with this source code.
*/

use CodeIgniter\Cache\CacheInterface;
use CodeIgniter\Config\Factories;
use CodeIgniter\Database\BaseConnection;
use CodeIgniter\Database\ConnectionInterface;
use CodeIgniter\Debug\Timer;
use CodeIgniter\Files\Exceptions\FileNotFoundException;
use CodeIgniter\HTTP\Exceptions\HTTPException;
use CodeIgniter\HTTP\RedirectResponse;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use CodeIgniter\HTTP\URI;
use CodeIgniter\Session\Session;
use CodeIgniter\Test\TestLogger;
use Config\App;
use Config\Database;
Expand Down Expand Up @@ -901,17 +905,17 @@ function old(string $key, $default = null, $escape = 'html')
*
* If more control is needed, you must use $response->redirect explicitly.
*
* @param string $uri
* @param string $route
*
* @return RedirectResponse
*/
function redirect(string $uri = null): RedirectResponse
function redirect(string $route = null): RedirectResponse
{
$response = Services::redirectResponse(null, true);

if (! empty($uri))
if (! empty($route))
{
return $response->route($uri);
return $response->route($route);
}

return $response;
Expand Down