Skip to content

Commit

Permalink
Dev: applid fix for php 7.2 (tecnickcom/TCPDF#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
lacrioque committed Feb 15, 2018
1 parent e7957d5 commit b8f6e83
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions application/third_party/tcpdf/tcpdf.php
Expand Up @@ -12576,7 +12576,7 @@ protected function _addfield($type, $name, $x, $y, $w, $h, $prop) {
$k = $this->k;
$this->javascript .= sprintf("f".$name."=this.addField('%s','%s',%u,[%F,%F,%F,%F]);", $name, $type, $this->PageNo()-1, $x*$k, ($this->h-$y)*$k+1, ($x+$w)*$k, ($this->h-$y-$h)*$k+1)."\n";
$this->javascript .= 'f'.$name.'.textSize='.$this->FontSizePt.";\n";
while (list($key, $val) = each($prop)) {
foreach($prop as $key => $val) {
if (strcmp(substr($key, -5), 'Color') == 0) {
$val = TCPDF_COLORS::_JScolor($val);
} else {
Expand Down Expand Up @@ -16539,9 +16539,9 @@ protected function getHtmlDomArray($html) {
// get attributes
preg_match_all('/([^=\s]*)[\s]*=[\s]*"([^"]*)"/', $element, $attr_array, PREG_PATTERN_ORDER);
$dom[$key]['attribute'] = array(); // reset attribute array
while (list($id, $name) = each($attr_array[1])) {
$dom[$key]['attribute'][strtolower($name)] = $attr_array[2][$id];
}
foreach($attr_array[1] as $id => $name) {
$dom[$key]['attribute'][strtolower($name)] = $attr_array[2][$id];
}
if (!empty($css)) {
// merge CSS style to current style
list($dom[$key]['csssel'], $dom[$key]['cssdata']) = TCPDF_STATIC::getCSSdataArray($dom, $key, $css);
Expand All @@ -16552,10 +16552,10 @@ protected function getHtmlDomArray($html) {
// get style attributes
preg_match_all('/([^;:\s]*):([^;]*)/', $dom[$key]['attribute']['style'], $style_array, PREG_PATTERN_ORDER);
$dom[$key]['style'] = array(); // reset style attribute array
while (list($id, $name) = each($style_array[1])) {
// in case of duplicate attribute the last replace the previous
$dom[$key]['style'][strtolower($name)] = trim($style_array[2][$id]);
}
foreach($style_array[1] as $id => $name) {
// in case of duplicate attribute the last replace the previous
$dom[$key]['style'][strtolower($name)] = trim($style_array[2][$id]);
}
// --- get some style attributes ---
// text direction
if (isset($dom[$key]['style']['direction'])) {
Expand Down

0 comments on commit b8f6e83

Please sign in to comment.