Skip to content

Commit

Permalink
Start session whenver using the old command. Fixes #1795
Browse files Browse the repository at this point in the history
  • Loading branch information
lonnieezell committed Mar 12, 2019
1 parent b2fda54 commit 895ae04
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion system/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ function remove_invisible_characters(string $str, bool $url_encoded = true): str
* 2. {namespace}/Helpers
* 3. system/Helpers
*
* @param string|array $filenames
* @param string|array $filenames
* @throws \CodeIgniter\Files\Exceptions\FileNotFoundException
*/
function helper($filenames)
Expand Down Expand Up @@ -825,6 +825,12 @@ function force_https(int $duration = 31536000, RequestInterface $request = null,
*/
function old(string $key, $default = null, $escape = 'html')
{
// Ensure the session is loaded
if (session_status() === PHP_SESSION_NONE && ENVIRONMENT !== 'testing')
{
session();
}

$request = Services::request();

$value = $request->getOldInput($key);
Expand Down

0 comments on commit 895ae04

Please sign in to comment.