From cf13e067eb87f505241653040db0a1cbb84c6537 Mon Sep 17 00:00:00 2001 From: Phurinat Puekkham Date: Mon, 4 Dec 2017 19:40:08 +0700 Subject: [PATCH 1/4] Update composer.json more secure --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 71bdd81..b7dda2f 100755 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "laravelcollective/html", "description": "HTML and Form Builders for the Laravel Framework", "license": "MIT", - "homepage": "http://laravelcollective.com", + "homepage": "https://laravelcollective.com", "support": { "issues": "https://github.com/LaravelCollective/html/issues", "source": "https://github.com/LaravelCollective/html" From 8f7bc4d09793c74ade0ea22b2fa30f8372263a9e Mon Sep 17 00:00:00 2001 From: Marcus Vinicius Araujo Date: Mon, 18 Dec 2017 17:23:46 -0200 Subject: [PATCH 2/4] #452 This shall be occuring for check-boxes. Please, check'em for us. --- src/FormBuilder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FormBuilder.php b/src/FormBuilder.php index 2b69ac0..195f195 100644 --- a/src/FormBuilder.php +++ b/src/FormBuilder.php @@ -865,7 +865,7 @@ class FormBuilder return false; } - if ($this->missingOldAndModel($name) && !$request) { + if ($this->missingOldAndModel($name) && is_null($request)) { return $checked; } From d621ce1357687ca4dcf1f744a1da939098f0e39e Mon Sep 17 00:00:00 2001 From: nickurt Date: Wed, 3 Jan 2018 14:25:43 +0100 Subject: [PATCH 3/4] remove php_eol statements by html-tags #456 --- src/HtmlBuilder.php | 10 +++++----- tests/HtmlBuilderTest.php | 14 +++++++------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/HtmlBuilder.php b/src/HtmlBuilder.php index d2ba3cd..8cecc65 100755 --- a/src/HtmlBuilder.php +++ b/src/HtmlBuilder.php @@ -78,7 +78,7 @@ class HtmlBuilder { $attributes['src'] = $this->url->asset($url, $secure); - return $this->toHtmlString('attributes($attributes) . '>' . PHP_EOL); + return $this->toHtmlString('attributes($attributes) . '>'); } /** @@ -98,7 +98,7 @@ class HtmlBuilder $attributes['href'] = $this->url->asset($url, $secure); - return $this->toHtmlString('attributes($attributes) . '>' . PHP_EOL); + return $this->toHtmlString('attributes($attributes) . '>'); } /** @@ -136,7 +136,7 @@ class HtmlBuilder $attributes['href'] = $this->url->asset($url, $secure); - return $this->toHtmlString('attributes($attributes) . '>' . PHP_EOL); + return $this->toHtmlString('attributes($attributes) . '>'); } /** @@ -511,7 +511,7 @@ class HtmlBuilder $attributes = array_merge($defaults, $attributes); - return $this->toHtmlString('attributes($attributes) . '>' . PHP_EOL); + return $this->toHtmlString('attributes($attributes) . '>'); } /** @@ -526,7 +526,7 @@ class HtmlBuilder public function tag($tag, $content, array $attributes = []) { $content = is_array($content) ? implode(PHP_EOL, $content) : $content; - return $this->toHtmlString('<' . $tag . $this->attributes($attributes) . '>' . PHP_EOL . $this->toHtmlString($content) . PHP_EOL . '' . PHP_EOL); + return $this->toHtmlString('<' . $tag . $this->attributes($attributes) . '>' . $this->toHtmlString($content) . ''); } /** diff --git a/tests/HtmlBuilderTest.php b/tests/HtmlBuilderTest.php index b5d7d99..a5bcb8b 100644 --- a/tests/HtmlBuilderTest.php +++ b/tests/HtmlBuilderTest.php @@ -65,7 +65,7 @@ class HtmlBuilderTest extends PHPUnit_Framework_TestCase { $result = $this->htmlBuilder->meta('description', 'Lorem ipsum dolor sit amet.'); - $this->assertEquals('' . PHP_EOL, $result); + $this->assertEquals('', $result); } public function testTag() @@ -83,17 +83,17 @@ class HtmlBuilderTest extends PHPUnit_Framework_TestCase $result4 = $this->htmlBuilder->tag('div', $content, ['class' => 'row']); - $this->assertEquals('

' . PHP_EOL . 'Lorem ipsum dolor sit amet.' . PHP_EOL . '

' . PHP_EOL, $result1); - $this->assertEquals('

' . PHP_EOL . 'Lorem ipsum dolor sit amet.' . PHP_EOL . '

' . PHP_EOL, $result2); - $this->assertEquals('
' . PHP_EOL . '

Lorem ipsum dolor sit amet.

' . PHP_EOL . '
' . PHP_EOL, $result3); - $this->assertEquals('
' . PHP_EOL . '' . PHP_EOL . '' . PHP_EOL . '
' . PHP_EOL, $result4); + $this->assertEquals('

Lorem ipsum dolor sit amet.

', $result1); + $this->assertEquals('

Lorem ipsum dolor sit amet.

', $result2); + $this->assertEquals('

Lorem ipsum dolor sit amet.

', $result3); + $this->assertEquals('
', $result4); } public function testMetaOpenGraph() { $result = $this->htmlBuilder->meta(null, 'website', ['property' => 'og:type']); - $this->assertEquals('' . PHP_EOL, $result); + $this->assertEquals('', $result); } public function testFavicon() @@ -102,7 +102,7 @@ class HtmlBuilderTest extends PHPUnit_Framework_TestCase $target = $this->urlGenerator->to('bar.ico'); $result = $this->htmlBuilder->favicon('http://foo.com/bar.ico'); - $this->assertEquals('' . PHP_EOL, $result); + $this->assertEquals('', $result); } public function testComponentRegistration() From 29253c13a311b11e437cf0d9e1247375a74a97e4 Mon Sep 17 00:00:00 2001 From: nickurt Date: Wed, 3 Jan 2018 14:50:42 +0100 Subject: [PATCH 4/4] fixed tests .. --- src/HtmlBuilder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/HtmlBuilder.php b/src/HtmlBuilder.php index 8cecc65..210c7e7 100755 --- a/src/HtmlBuilder.php +++ b/src/HtmlBuilder.php @@ -525,7 +525,7 @@ class HtmlBuilder */ public function tag($tag, $content, array $attributes = []) { - $content = is_array($content) ? implode(PHP_EOL, $content) : $content; + $content = is_array($content) ? implode('', $content) : $content; return $this->toHtmlString('<' . $tag . $this->attributes($attributes) . '>' . $this->toHtmlString($content) . ''); }