Skip to content

Commit

Permalink
Issue: MPDF Export PHP < 7.0
Browse files Browse the repository at this point in the history
    This commit fixes an issue where using MPDF to print Tickets did not work if the PHP version was < 7.0 because MPDF called the random_int function which is only available for PHP 7.0+. Now, we check the PHP version before printing, and if it is less than 7.0, we use the rand function. If it is >= 7.0, we continue to use the random_int function.
  • Loading branch information
aydreeihn committed Mar 26, 2019
1 parent 78a673f commit 340472b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bootstrap.php
Expand Up @@ -295,6 +295,12 @@ function mb_substr_count($haystack, $needle) {
if (extension_loaded('iconv'))
iconv_set_encoding('internal_encoding', 'UTF-8');

if (intval(phpversion()) < 7) {
function random_int($a, $b) {
return rand($a, $b);
}
}

function mb_str_wc($str) {
return count(preg_split('~[^\p{L}\p{N}\'].+~u', trim($str)));
}
Expand Down

0 comments on commit 340472b

Please sign in to comment.