aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/3rdparty/libraries/mpdf/includes/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/3rdparty/libraries/mpdf/includes/functions.php')
-rw-r--r--inc/3rdparty/libraries/mpdf/includes/functions.php32
1 files changed, 29 insertions, 3 deletions
diff --git a/inc/3rdparty/libraries/mpdf/includes/functions.php b/inc/3rdparty/libraries/mpdf/includes/functions.php
index 03f47090..78683af8 100644
--- a/inc/3rdparty/libraries/mpdf/includes/functions.php
+++ b/inc/3rdparty/libraries/mpdf/includes/functions.php
@@ -1,5 +1,13 @@
1<?php 1<?php
2 2
3// mPDF 5.7
4// Replace a section of an array with the elements in reverse
5function array_splice_reverse(&$arr, $offset, $length) {
6 $tmp = (array_reverse(array_slice($arr, $offset, $length)));
7 array_splice($arr, $offset, $length, $tmp);
8}
9
10
3// mPDF 5.6.23 11// mPDF 5.6.23
4function array_insert(&$array, $value, $offset) { 12function array_insert(&$array, $value, $offset) {
5 if (is_array($array)) { 13 if (is_array($array)) {
@@ -92,12 +100,30 @@ function PreparePreText($text,$ff='//FF//') {
92if(!function_exists('strcode2utf')){ 100if(!function_exists('strcode2utf')){
93 function strcode2utf($str,$lo=true) { 101 function strcode2utf($str,$lo=true) {
94 //converts all the &#nnn; and &#xhhh; in a string to Unicode 102 //converts all the &#nnn; and &#xhhh; in a string to Unicode
95 if ($lo) { $lo = 1; } else { $lo = 0; } 103 // mPDF 5.7
96 $str = preg_replace('/\&\#([0-9]+)\;/me', "code2utf('\\1',{$lo})",$str); 104 if ($lo) {
97 $str = preg_replace('/\&\#x([0-9a-fA-F]+)\;/me', "codeHex2utf('\\1',{$lo})",$str); 105 $str = preg_replace_callback('/\&\#([0-9]+)\;/m', 'code2utf_lo_callback', $str);
106 $str = preg_replace_callback('/\&\#x([0-9a-fA-F]+)\;/m', 'codeHex2utf_lo_callback', $str);
107 }
108 else {
109 $str = preg_replace_callback('/\&\#([0-9]+)\;/m', 'code2utf_callback', $str);
110 $str = preg_replace_callback('/\&\#x([0-9a-fA-F]+)\;/m', 'codeHex2utf_callback', $str);
111 }
98 return $str; 112 return $str;
99 } 113 }
100} 114}
115function code2utf_callback($matches) {
116 return code2utf($matches[1], 0);
117}
118function code2utf_lo_callback($matches) {
119 return code2utf($matches[1], 1);
120}
121function codeHex2utf_callback($matches) {
122 return codeHex2utf($matches[1], 0);
123}
124function codeHex2utf_lo_callback($matches) {
125 return codeHex2utf($matches[1], 1);
126}
101 127
102if(!function_exists('code2utf')){ 128if(!function_exists('code2utf')){
103 function code2utf($num,$lo=true){ 129 function code2utf($num,$lo=true){