Fixed deprecated issues in html2pdf converter

This commit is contained in:
Andre Lorbach 2015-02-20 17:38:32 +01:00
parent 6a917a62f8
commit 98c173a29f
2 changed files with 16 additions and 11 deletions

View File

@ -1383,7 +1383,8 @@ function Image($file,$x,$y,$w=0,$h=0,$type='',$link='',$paint=true)
}
$type=strtolower($type);
$mqr=get_magic_quotes_runtime();
set_magic_quotes_runtime(0);
if(version_compare(PHP_VERSION, '5.3.0', '<'))
set_magic_quotes_runtime(0);
if($type=='jpg' or $type=='jpeg') $info=$this->_parsejpg($file);
elseif($type=='png') $info=$this->_parsepng($file);
elseif($type=='gif') $info=$this->_parsegif($file); //EDITEI - GIF format included
@ -1394,7 +1395,8 @@ function Image($file,$x,$y,$w=0,$h=0,$type='',$link='',$paint=true)
if(!method_exists($this,$mtd)) $this->Error('Unsupported image type: '.$type);
$info=$this->$mtd($file);
}
set_magic_quotes_runtime($mqr);
if(version_compare(PHP_VERSION, '5.3.0', '<'))
set_magic_quotes_runtime($mqr);
$info['i']=count($this->images)+1;
$this->images[$file]=$info;
}
@ -1811,7 +1813,8 @@ function _putfonts()
$this->_out('endobj');
}
$mqr=get_magic_quotes_runtime();
set_magic_quotes_runtime(0);
if(version_compare(PHP_VERSION, '5.3.0', '<'))
set_magic_quotes_runtime(0);
foreach($this->FontFiles as $file=>$info)
{
//Font file embedding
@ -1834,7 +1837,8 @@ function _putfonts()
fclose($f);
$this->_out('endobj');
}
set_magic_quotes_runtime($mqr);
if(version_compare(PHP_VERSION, '5.3.0', '<'))
set_magic_quotes_runtime($mqr);
foreach($this->fonts as $k=>$font)
{
//Font objects

View File

@ -461,13 +461,14 @@ function WriteHTML($html)
$attr=array();
if (!empty($contents))
{
foreach($contents[0] as $v)
{
if(ereg('^([^=]*)=["\']?([^"\']*)["\']?$',$v,$a3))
{
$attr[strtoupper($a3[1])]=$a3[2];
}
}
foreach($contents[0] as $v)
{
// FIXED BY ANDRE
//if(ereg('^([^=]*)=["\']?([^"\']*)["\']?$',$v,$a3))
if(preg_match('/^([^=]*)=["\']?([^"\']*)["\']?$/',$v,$a3))
$attr[strtoupper($a3[1])]=$a3[2];
// FIXED BY ANDRE
}
}
$this->OpenTag($tag,$attr);
}