Skip to content

Commit

Permalink
Merge branch '5.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
TimWolla committed Jul 28, 2023
2 parents 32d8691 + c4f8608 commit 62f4b76
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions wcfsetup/install/files/lib/util/FileUtil.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -616,6 +616,16 @@ public static function getIconNameByFilename(string $filename): string
return '';
}

/**
* Returns whether the given $extension might allow for execution of
* PHP code and thus must not be used for untrusted files uploaded by
* a user.
*/
public function extensionAllowsPhpExecution(string $extension): bool
{
return !!\preg_match('/^\.?(php[0-9]*|phtml)$/i', $extension);
}

/**
* Forbid creation of FileUtil objects.
*/
Expand Down

0 comments on commit 62f4b76

Please sign in to comment.