From 4946421e38b16ae43e4260090b0dcab82fc3d6ad Mon Sep 17 00:00:00 2001 From: Schneider Roland Date: Tue, 27 Dec 2022 14:43:06 +0100 Subject: [PATCH] update mpdf lib version from 6 to 8 --- patches/vendor/mpdf/mpdf/classes/cssmgr.php | 1722 ------ .../vendor/mpdf/mpdf/classes/ttfontsuni.php | 4732 ----------------- 2 files changed, 6454 deletions(-) delete mode 100644 patches/vendor/mpdf/mpdf/classes/cssmgr.php delete mode 100644 patches/vendor/mpdf/mpdf/classes/ttfontsuni.php diff --git a/patches/vendor/mpdf/mpdf/classes/cssmgr.php b/patches/vendor/mpdf/mpdf/classes/cssmgr.php deleted file mode 100644 index b56535c..0000000 --- a/patches/vendor/mpdf/mpdf/classes/cssmgr.php +++ /dev/null @@ -1,1722 +0,0 @@ -mpdf = $mpdf; - $this->tablecascadeCSS = array(); - $this->CSS=array(); - $this->cascadeCSS = array(); - $this->tbCSSlvl = 0; -} - -function ReadCSS($html) { - preg_match_all('/]*media=["\']([^"\'>]*)["\'].*?<\/style>/is',$html,$m); - for($i=0; $impdf->CSSselectMedia && !preg_match('/('.trim($this->mpdf->CSSselectMedia).'|all)/i',$m[1][$i])) { - $html = preg_replace('/'.preg_quote($m[0][$i],'/').'/','',$html); - } - } - preg_match_all('/]*media=["\']([^"\'>]*)["\'].*?>/is',$html,$m); - for($i=0; $impdf->CSSselectMedia && !preg_match('/('.trim($this->mpdf->CSSselectMedia).'|all)/i',$m[1][$i])) { - $html = preg_replace('/'.preg_quote($m[0][$i],'/').'/','',$html); - } - } - - // mPDF 5.5.02 - // Remove Comment tags inside CSS as ', $html); - preg_match_all('/(.*?)<\/style>/si',$html,$m); - if (count($m[1])) { - for($i=0;$i)/s',' ',$m[1][$i]); - $sub = '>'.preg_replace('|/\*.*?\*/|s',' ',$sub).''; - $html = str_replace('>'.$m[1][$i].'', $sub, $html); - } - } - - - $html = preg_replace('//i','',$html); - $html = preg_replace('/<\!\-\-.*?\-\->/s',' ',$html); - - $match = 0; // no match for instance - $regexp = ''; // This helps debugging: showing what is the REAL string being processed - $CSSext = array(); - - //CSS inside external files - $regexp = '/]*rel=["\']stylesheet["\'][^>]*href=["\']([^>"\']*)["\'].*?>/si'; - $x = preg_match_all($regexp,$html,$cxt); - if ($x) { - $match += $x; - $CSSext = $cxt[1]; - } - $regexp = '/]*href=["\']([^>"\']*)["\'][^>]*?rel=["\']stylesheet["\'].*?>/si'; - $x = preg_match_all($regexp,$html,$cxt); - if ($x) { - $match += $x; - $CSSext = array_merge($CSSext,$cxt[1]); - } - - // look for @import stylesheets - //$regexp = '/@import url\([\'\"]{0,1}([^\)]*?\.css)[\'\"]{0,1}\)/si'; - $regexp = '/@import url\([\'\"]{0,1}([^\)]*?\.css(\?\S+)?)[\'\"]{0,1}\)/si'; - $x = preg_match_all($regexp,$html,$cxt); - if ($x) { - $match += $x; - $CSSext = array_merge($CSSext,$cxt[1]); - } - - // look for @import without the url() - //$regexp = '/@import [\'\"]{0,1}([^;]*?\.css)[\'\"]{0,1}/si'; - $regexp = '/@import [\'\"]{0,1}([^;]*?\.css(\?\S+)?)[\'\"]{0,1}/si'; - $x = preg_match_all($regexp,$html,$cxt); - if ($x) { - $match += $x; - $CSSext = array_merge($CSSext,$cxt[1]); - } - - $ind = 0; - $CSSstr = ''; - - if (!is_array($this->cascadeCSS)) $this->cascadeCSS = array(); - - while($match){ - $path = $CSSext[$ind]; - - $path = htmlspecialchars_decode($path); // mPDF 6 - - $this->mpdf->GetFullPath($path); - $CSSextblock = $this->mpdf->_get_file($path); - if ($CSSextblock) { - // look for embedded @import stylesheets in other stylesheets - // and fix url paths (including background-images) relative to stylesheet - //$regexpem = '/@import url\([\'\"]{0,1}(.*?\.css)[\'\"]{0,1}\)/si'; - $regexpem = '/@import url\([\'\"]{0,1}(.*?\.css(\?\S+)?)[\'\"]{0,1}\)/si'; - $xem = preg_match_all($regexpem,$CSSextblock,$cxtem); - $cssBasePath = preg_replace('/\/[^\/]*$/','',$path) . '/'; - if ($xem) { - foreach($cxtem[1] AS $cxtembedded) { - // path is relative to original stlyesheet!! - $this->mpdf->GetFullPath($cxtembedded, $cssBasePath ); - $match++; - $CSSext[] = $cxtembedded; - } - } - $regexpem = '/(background[^;]*url\s*\(\s*[\'\"]{0,1})([^\)\'\"]*)([\'\"]{0,1}\s*\))/si'; - $xem = preg_match_all($regexpem,$CSSextblock,$cxtem); - if ($xem) { - for ($i=0;$impdf->GetFullPath($embedded, $cssBasePath ); - $CSSextblock = preg_replace('/'.preg_quote($cxtem[0][$i],'/').'/', ($cxtem[1][$i].$embedded.$cxtem[3][$i]), $CSSextblock); - } - } - } - $CSSstr .= ' '.$CSSextblock; - } - $match--; - $ind++; - } //end of match - - $match = 0; // reset value, if needed - // CSS as