Skip to content

Commit c632cba

Browse files
committed
fix empty invalid check
1 parent ce8c3a1 commit c632cba

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/Cleaner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ protected function removeInlineEventListeners(string $value): string
6060
{
6161
$string = preg_replace($this->inlineListenersPattern, '', $value);
6262

63-
return empty($string) ? '' : $string;
63+
return !is_string($string) ? '' : $string;
6464
}
6565
}

tests/FilterXSSTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,4 +157,13 @@ public function it_clears_nested_inputs()
157157
], $this->request->all());
158158
}
159159

160+
/**
161+
* @test
162+
*/
163+
public function it_dont_convert_0_to_empty_string() {
164+
$this->responseFromMiddlewareWithInput($input = ['text' => '0']);
165+
166+
$this->assertEquals($input, $this->request->all());
167+
}
168+
160169
}

0 commit comments

Comments
 (0)