aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/3rdparty/libraries/mpdf/includes
diff options
context:
space:
mode:
authortcit <tcit@tcit.fr>2014-07-24 22:01:35 +0200
committertcit <tcit@tcit.fr>2014-07-24 22:01:35 +0200
commitd07abb5c42a816c94d05c5a1d7a78122e1b8b65c (patch)
tree38c9be0fba7c530cc1b4b6b43d127c38bfb45e37 /inc/3rdparty/libraries/mpdf/includes
parentfb9df0c269f36703909b8b259abbdbed29881ecd (diff)
downloadwallabag-d07abb5c42a816c94d05c5a1d7a78122e1b8b65c.tar.gz
wallabag-d07abb5c42a816c94d05c5a1d7a78122e1b8b65c.tar.zst
wallabag-d07abb5c42a816c94d05c5a1d7a78122e1b8b65c.zip
updated mpdf to 5.7.2
Diffstat (limited to 'inc/3rdparty/libraries/mpdf/includes')
-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){