Skip to content

Commit

Permalink
TW17181031 - Added unit tests for board.php (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
JayChurchward authored and mchurchward committed Jul 8, 2021
1 parent ea767fb commit baabe2f
Show file tree
Hide file tree
Showing 3 changed files with 563 additions and 2 deletions.
5 changes: 3 additions & 2 deletions classes/board.php
Original file line number Diff line number Diff line change
Expand Up @@ -559,8 +559,9 @@ public static function store_note_file($noteid, $attachment) {
* @return bool
*/
public static function valid_for_upload($attachment) {
$fileextension = strtolower(array_pop(explode('.', basename($attachment['filename']))));
if (!in_array($fileextension, explode(',', self::ACCEPTED_FILE_EXTENSIONS))) {
$fileparts = explode('.', basename($attachment['filename']));
$fileextension = strtolower(array_pop($fileparts));
if (!in_array($fileextension, explode(',', ACCEPTED_FILE_EXTENSIONS))) {
return false;
}
$filelength = strlen($attachment['filecontents']);
Expand Down
Loading

0 comments on commit baabe2f

Please sign in to comment.