FIX tcpdf vulnerability to roman numeral bomb, cf. tecnickom/TCPDF issue #315
This commit is contained in:
parent
bd52613331
commit
17773f8414
@ -175,6 +175,18 @@ In htdocs/includes/tecnickcom/tcpdf/tcpdf.php
|
|||||||
- protected $default_monospaced_font = 'courier';
|
- protected $default_monospaced_font = 'courier';
|
||||||
+ protected $default_monospaced_font = 'freemono';
|
+ protected $default_monospaced_font = 'freemono';
|
||||||
|
|
||||||
|
* In tecnickcom/tcpdf/include/tcpdf_static, in function intToRoman, right at the beginning
|
||||||
|
of the function, replace:
|
||||||
|
|
||||||
|
$roman = '';
|
||||||
|
|
||||||
|
with:
|
||||||
|
|
||||||
|
$roman = '';
|
||||||
|
if ($number >= 4000) {
|
||||||
|
// do not represent numbers above 4000 in Roman numerals
|
||||||
|
return strval($number);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1440,6 +1440,10 @@ class TCPDF_STATIC {
|
|||||||
*/
|
*/
|
||||||
public static function intToRoman($number) {
|
public static function intToRoman($number) {
|
||||||
$roman = '';
|
$roman = '';
|
||||||
|
if ($number >= 4000) {
|
||||||
|
// do not represent numbers above 4000 in Roman numerals
|
||||||
|
return strval($number);
|
||||||
|
}
|
||||||
while ($number >= 1000) {
|
while ($number >= 1000) {
|
||||||
$roman .= 'M';
|
$roman .= 'M';
|
||||||
$number -= 1000;
|
$number -= 1000;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user