File tree 2 files changed +16
-0
lines changed
2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,10 @@ public function extensionIsNotExcutable($excutable_extensions)
85
85
throw new ExcutableFileException ();
86
86
}
87
87
88
+ if (preg_match ('/[a-z]html/ ' , $ extension ) > 0 ) {
89
+ throw new ExcutableFileException ();
90
+ }
91
+
88
92
return $ this ;
89
93
}
90
94
Original file line number Diff line number Diff line change @@ -180,6 +180,18 @@ public function testFailsExtensionIsNotExcutableWithExtensionsStartsWithPhp()
180
180
$ validator ->extensionIsNotExcutable (['php ' , 'html ' ]);
181
181
}
182
182
183
+ public function testFailsExtensionIsNotExcutableWithExtensionsEndsWithHtml ()
184
+ {
185
+ $ uploaded_file = m::mock (UploadedFile::class);
186
+ $ uploaded_file ->shouldReceive ('getClientOriginalExtension ' )->andReturn ('dhtml ' );
187
+
188
+ $ validator = new LfmUploadValidator ($ uploaded_file );
189
+
190
+ $ this ->expectException (ExcutableFileException::class);
191
+
192
+ $ validator ->extensionIsNotExcutable ();
193
+ }
194
+
183
195
public function testFailsExtensionIsValidWithSpecialCharacters ()
184
196
{
185
197
$ uploaded_file = m::mock (UploadedFile::class);
You can’t perform that action at this time.
0 commit comments