diff --git a/src/classes/html2fpdf/fpdf.php b/src/classes/html2fpdf/fpdf.php
index 7dcfbee..e4fdd01 100644
--- a/src/classes/html2fpdf/fpdf.php
+++ b/src/classes/html2fpdf/fpdf.php
@@ -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
diff --git a/src/classes/html2fpdf/html2fpdf.php b/src/classes/html2fpdf/html2fpdf.php
index 011f0ca..c7a32fc 100644
--- a/src/classes/html2fpdf/html2fpdf.php
+++ b/src/classes/html2fpdf/html2fpdf.php
@@ -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);
}