mirror of
https://github.com/tecnickcom/TCPDF.git
synced 2025-04-08 16:22:28 +02:00
Fix vulnerability to roman numeral bombs (#315)
Co-authored-by: Nicola Asuni <nicolaasuni@users.noreply.github.com>
This commit is contained in:
parent
f0e42daeae
commit
e17b28015d
@ -1440,6 +1440,10 @@ class TCPDF_STATIC {
|
||||
*/
|
||||
public static function intToRoman($number) {
|
||||
$roman = '';
|
||||
if ($number >= 4000) {
|
||||
// do not represent numbers above 4000 in Roman numerals
|
||||
return strval($number);
|
||||
}
|
||||
while ($number >= 1000) {
|
||||
$roman .= 'M';
|
||||
$number -= 1000;
|
||||
|
Loading…
x
Reference in New Issue
Block a user