diff --git a/system/Helpers/form_helper.php b/system/Helpers/form_helper.php index 54a86f9c2c00..c073f0eebe60 100644 --- a/system/Helpers/form_helper.php +++ b/system/Helpers/form_helper.php @@ -28,7 +28,7 @@ function form_open(string $action = '', array $attributes = [], array $hidden = $action = site_url($action); } - $attributes = stringify_attributes($attributes); + $attributes = str_replace('/', '/', stringify_attributes($attributes)); if (stripos($attributes, 'method=') === false) { diff --git a/tests/system/Helpers/FormHelperTest.php b/tests/system/Helpers/FormHelperTest.php index e73e48d488b5..d9e371127ce0 100644 --- a/tests/system/Helpers/FormHelperTest.php +++ b/tests/system/Helpers/FormHelperTest.php @@ -7,6 +7,15 @@ public function setUp() helper('form'); } // ------------------------------------------------------------------------ + public function testFormMultiPart() + { + helper('url'); + $expected = <<\n +EOH; + $this->assertEquals($expected, form_open_multipart('user/login', ['class'=>'form'])); + } + // ------------------------------------------------------------------------ public function textFormHidden() { $expected = <<