From bc097b24e20b4aee78c6291fe93fef37de1ad485 Mon Sep 17 00:00:00 2001 From: mlantz Date: Wed, 26 Apr 2017 11:51:23 -0400 Subject: [PATCH] Reversion to the original state with the e method --- src/FormBuilder.php | 2 +- src/HtmlBuilder.php | 2 +- tests/FormBuilderTest.php | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/FormBuilder.php b/src/FormBuilder.php index 62fc08a..5ae7ecc 100644 --- a/src/FormBuilder.php +++ b/src/FormBuilder.php @@ -485,7 +485,7 @@ class FormBuilder // the element. Then we'll create the final textarea elements HTML for us. $options = $this->html->attributes($options); - return $this->toHtmlString('' . $value. ''); + return $this->toHtmlString('' . e($value). ''); } /** diff --git a/src/HtmlBuilder.php b/src/HtmlBuilder.php index 73796fb..e531792 100755 --- a/src/HtmlBuilder.php +++ b/src/HtmlBuilder.php @@ -449,7 +449,7 @@ class HtmlBuilder } if (! is_null($value)) { - return $key . '="' . $value . '"'; + return $key . '="' . e($value) . '"'; } } diff --git a/tests/FormBuilderTest.php b/tests/FormBuilderTest.php index 3114627..d117158 100644 --- a/tests/FormBuilderTest.php +++ b/tests/FormBuilderTest.php @@ -240,14 +240,14 @@ class FormBuilderTest extends PHPUnit_Framework_TestCase $form3 = $this->formBuilder->textarea('foo', null, ['class' => 'span2']); $form4 = $this->formBuilder->textarea('foo', null, ['size' => '60x15']); $form5 = $this->formBuilder->textarea('encoded_html', 'Eggs & Sausage', ['size' => '60x50']); - $form6 = $this->formBuilder->textarea('encoded_html', 'Eggs &&& Sausage', ['size' => '60x50']); + $form6 = $this->formBuilder->textarea('encoded_html', 'Eggs && Sausage', ['size' => '60x50']); $this->assertEquals('', $form1); $this->assertEquals('', $form2); $this->assertEquals('', $form3); $this->assertEquals('', $form4); - $this->assertEquals('', $form5); - $this->assertEquals('', $form6); + $this->assertEquals('', $form5); + $this->assertEquals('', $form6); } public function testSelect()