mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
fix form helper set_radio
This commit is contained in:
parent
25922b5cfc
commit
6b6703dab1
@ -925,7 +925,7 @@ if ( ! function_exists('set_radio'))
|
||||
|
||||
// Unchecked checkbox and radio inputs are not even submitted by browsers ...
|
||||
$result = '';
|
||||
if (!empty($request->getPost()) || !empty(old($field)))
|
||||
if (!empty($input = $request->getPost($field)) || !empty($input = old($field)))
|
||||
{
|
||||
$result = ($input === $value) ? ' checked="checked"' : '';
|
||||
}
|
||||
|
@ -756,6 +756,10 @@ EOH;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
/**
|
||||
* @runInSeparateProcess
|
||||
* @preserveGlobalState disabled
|
||||
*/
|
||||
public function testSetRadio()
|
||||
{
|
||||
$_SESSION = [
|
||||
@ -771,6 +775,10 @@ EOH;
|
||||
unset($_SESSION['_ci_old_input']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @runInSeparateProcess
|
||||
* @preserveGlobalState disabled
|
||||
*/
|
||||
public function testSetRadioFromPost()
|
||||
{
|
||||
$_POST['bar'] = 'baz';
|
||||
|
Loading…
x
Reference in New Issue
Block a user