diff -urN php-barcode-0.3pl1/CHANGELOG php-barcode-0.4/CHANGELOG
--- php-barcode-0.3pl1/CHANGELOG	1970-01-01 01:00:00.000000000 +0100
+++ php-barcode-0.4/CHANGELOG	2011-08-15 14:34:05.000000000 +0200
@@ -0,0 +1,12 @@
+Version 0.4, 2011-08-15, Folke Ashberg <folke@ashberg.de>
+ * Bugfix: Correct Shell-Escaping calling genbarcode
+ * Use of preg functions instead of ereg
+ * Shipping Free-TTF file
+ * several fixups
+
+Version 0.3pl1, Folke Ashberg <folke@ashberg.de>
+ + support for magic_quotes_gpc set to off
+
+Version 0.3, Folke Ashberg <folke@ashberg.de>
+ + Windows compatible
+ + various code-fixes
Binary files php-barcode-0.3pl1/FreeSansBold.ttf and php-barcode-0.4/FreeSansBold.ttf differ
diff -urN php-barcode-0.3pl1/README php-barcode-0.4/README
--- php-barcode-0.3pl1/README	2004-06-26 12:37:15.000000000 +0200
+++ php-barcode-0.4/README	2011-08-15 14:51:13.000000000 +0200
@@ -1,4 +1,4 @@
-PHP-Barcode 0.3pl1
+PHP-Barcode 0.4
 
 PHP-Barcode generates
   - Barcode-Images using libgd (png, jpg,gif),
@@ -11,11 +11,11 @@
     barcode-encoder which uses GNU-Barcode
     genbarcode can encode EAN-13, EAN-8, UPC, ISBN, 39, 128(a,b,c),
     I25, 128RAW, CBR, MSI, PLS
-    genbarcode is available at www.ashberg.de/bar 
+    genbarcode is available at www.ashberg.de/php-barcode 
 
-(C) 2001,2002,2003,2004 by Folke Ashberg <folke@ashberg.de>
+(C) 2001,2002,2003,2004,2011 by Folke Ashberg <folke@ashberg.de>
 
-The newest version can be found at http://www.ashberg.de/bar
+The newest version can be found at http://www.ashberg.de/php-barcode
 
 
 INSTALLATION:
@@ -24,7 +24,7 @@
    You need php>4 on your system.
    You need the gd2-extension to be able to render images.
    You need a TrueTypeFont if you want to see the CODE below the bars.
-   You need genbarcode (from www.ashberg.de/bar) in you want to use
+   You need genbarcode (from www.ashberg.de/php-barcode) in you want to use
        another encoding than EAN-12/EAN-12/ISBN
 
  Copy the following files into your html/php-directory
@@ -48,7 +48,7 @@
   OPTIONAL - genbarcode:
       If you want to generate not only EAN-12/EAN-13/ISBN-Codes you have to install
       genbarcode, a small unix-commandline tool which uses GNU-Barcode.
-      genbarcode is available http://www.ashberg.de/bar , read genbarcodes
+      genbarcode is available http://www.ashberg.de/php-barcode , read genbarcodes
       README for installation.
       If you have installed genbarcode not to /usr/bin set the $genbarcode_loc
       in php-barcode.php .
diff -urN php-barcode-0.3pl1/barcode.php php-barcode-0.4/barcode.php
--- php-barcode-0.3pl1/barcode.php	2004-06-26 12:36:52.000000000 +0200
+++ php-barcode-0.4/barcode.php	2011-08-15 14:46:53.000000000 +0200
@@ -2,11 +2,11 @@
 /*
 
  * Image-Creator / Sample
- * Part of PHP-Barcode 0.3pl1
+ * Part of PHP-Barcode 0.4
  
  * (C) 2001,2002,2003,2004 by Folke Ashberg <folke@ashberg.de>
  
- * The newest version can be found at http://www.ashberg.de/bar
+ * The newest version can be found at http://www.ashberg.de/php-barcode
  
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
diff -urN php-barcode-0.3pl1/encode_bars.php php-barcode-0.4/encode_bars.php
--- php-barcode-0.3pl1/encode_bars.php	2004-06-26 12:37:02.000000000 +0200
+++ php-barcode-0.4/encode_bars.php	2011-08-15 14:46:59.000000000 +0200
@@ -2,11 +2,11 @@
 /*
 
  * Built-In Encoders
- * Part of PHP-Barcode 0.3pl1
+ * Part of PHP-Barcode 0.4
  
- * (C) 2001,2002,2003,2004 by Folke Ashberg <folke@ashberg.de>
+ * (C) 2001,2002,2003,2004,2011 by Folke Ashberg <folke@ashberg.de>
  
- * The newest version can be found at http://www.ashberg.de/bar
+ * The newest version can be found at http://www.ashberg.de/php-barcode
  
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -47,14 +47,14 @@
     $guards=array("9a1a","1a1a1","a1a");
 
     $ean=trim($ean);
-    if (eregi("[^0-9]",$ean)){
+    if (preg_match("#[^0-9]#i",$ean)){
 	return array("text"=>"Invalid EAN-Code");
     }
     $encoding=strtoupper($encoding);
     if ($encoding=="ISBN"){
-	if (!ereg("^978", $ean)) $ean="978".$ean;
+	if (!preg_match("#^978#", $ean)) $ean="978".$ean;
     }
-    if (ereg("^978", $ean)) $encoding="ISBN";
+    if (preg_match("#^978#", $ean)) $encoding="ISBN";
     if (strlen($ean)<12 || strlen($ean)>13){
 	return array("text"=>"Invalid $encoding Code (must have 12/13 numbers)");
     }
diff -urN php-barcode-0.3pl1/php-barcode.php php-barcode-0.4/php-barcode.php
--- php-barcode-0.3pl1/php-barcode.php	2004-06-26 12:36:35.000000000 +0200
+++ php-barcode-0.4/php-barcode.php	2011-08-15 14:54:56.000000000 +0200
@@ -1,6 +1,6 @@
 <?
 /*
- * PHP-Barcode 0.3pl1
+ * PHP-Barcode 0.4
  
  * PHP-Barcode generates
  *   - Barcode-Images using libgd2 (png, jpg, gif)
@@ -13,11 +13,11 @@
  *     barcode-encoder which uses GNU-Barcode
  *     genbarcode can encode EAN-13, EAN-8, UPC, ISBN, 39, 128(a,b,c),
  *     I25, 128RAW, CBR, MSI, PLS
- *     genbarcode is available at www.ashberg.de/bar 
+ *     genbarcode is available at www.ashberg.de/php-barcode 
  
- * (C) 2001,2002,2003,2004 by Folke Ashberg <folke@ashberg.de>
+ * (C) 2001,2002,2003,2004,2011 by Folke Ashberg <folke@ashberg.de>
  
- * The newest version can be found at http://www.ashberg.de/bar
+ * The newest version can be found at http://www.ashberg.de/php-barcode
  
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -50,24 +50,8 @@
 /*                          FONT FILE                                   */
 /* ******************************************************************** */
 /* location the the ttf-font */
-/* the file arialbd.ttf isn't included! */
 
-/* SAMPLE1 : 
- * use arialbd.ttf located in same directory like the script
- * which includes/requires php-barcode.php
- */
-$font_loc=dirname($_SERVER["PATH_TRANSLATED"])."/"."arialbd.ttf";
-
-/* SAMPLE2 :
- * use font specified by full-path
- */
-//$font_loc="/path/font.ttf"
-
-/* Automatic-Detection of Font if running Windows
- * kick this lines if you don't need them! */
-if (isset($_ENV['windir']) && file_exists($_ENV['windir'])){
-    $font_loc=$_ENV['windir']."\Fonts\arialbd.ttf";
-}
+$font_loc=dirname(__FILE__)."/"."FreeSansBold.ttf";
 
 /* ******************************************************************** */
 /*                          GENBARCODE                                  */
@@ -126,7 +110,7 @@
 	    $width=false;
 	    continue;
 	}
-	if (ereg("[a-z]", $val)){
+	if (preg_match("#[a-z]#", $val)){
 	    /* tall bar */
 	    $val=ord($val)-ord('a')+1;
 	} 
@@ -155,7 +139,7 @@
 	print "The author of php-barcode will give not support on this topic!<BR>\n";
 	print "<BR>\n";
 	print "<BR>\n";
-	print "<A HREF=\"http://www.ashberg.de/bar/\">Folke Ashberg's OpenSource PHP-Barcode</A><BR>\n";
+	print "<A HREF=\"http://www.ashberg.de/php-barcode/\">Folke Ashberg's OpenSource PHP-Barcode</A><BR>\n";
 	return "";
     }
     $im=imagecreate($total_x, $total_y);
@@ -176,7 +160,7 @@
 	    $width=false;
 	    continue;
 	}
-	if (ereg("[a-z]", $val)){
+	if (preg_match("#[a-z]#", $val)){
 	    /* tall bar */
 	    $val=ord($val)-ord('a')+1;
 	    $h=$height2;
@@ -236,7 +220,7 @@
 	    for ($a=0;$a<$val;$a++) $bar_line.="-";
 	    continue;
 	}
-	if (ereg("[a-z]", $val)){
+	if (preg_match("#[a-z]#", $val)){
 	    $val=ord($val)-ord('a')+1;
 	    $h=$heigh2;
 	    for ($a=0;$a<$val;$a++) $bar_line.="I";
@@ -281,34 +265,34 @@
     $height=round($total_y-($scale*10));
     $height2=round($total_y)-$space['bottom'];
     $out=
-      '<Table border=0 cellspacing=0 cellpadding=0 bgcolor="white">'."\n".
-      '<TR><TD><img src=white.png height="'.$space['top'].'" width=1></TD></TR>'."\n".
-      '<TR><TD>'."\n".
-      '<IMG src=white.png height="'.$height2.'" width="'.$space['left'].'">';
+      '<table border=0 cellspacing=0 cellpadding=0 bgcolor="white">'."\n".
+      '<tr><td><img src="white.png" height="'.$space['top'].'" width="1" alt=" "></td></tr>'."\n".
+      '<tr><td>'."\n".
+      '<img src="white.png" height="'.$height2.'" width="'.$space['left'].'" alt="#"/>';
     
     $width=true;
     for ($i=0;$i<strlen($bars);$i++){
 	$val=strtolower($bars[$i]);
 	if ($width){
 	    $w=$val*$scale;
-	    if ($w>0) $out.="<IMG src=white.png height=\"$total_y\" width=\"$w\" align=top>";
+	    if ($w>0) $out.='<img src="white.png" height="'.$total_y.'" width="'.$w.'" align="top" alt="" />';
 	    $width=false;
 	    continue;
 	}
-	if (ereg("[a-z]", $val)){
+	if (preg_match("#[a-z]#", $val)){
 	    //hoher strich
 	    $val=ord($val)-ord('a')+1;
 	    $h=$height2;
 	}else $h=$height;
 	$w=$val*$scale;
-	if ($w>0) $out.='<IMG src="black.png" height="'.$h.'" width="'.$w.'" align=top>';
+	if ($w>0) $out.='<img src="black.png" height="'.$h.'" width="'.$w.'" align="top" />';
 	$width=true;
     }
     $out.=
-      '<IMG src=white.png height="'.$height2.'" width=".'.$space['right'].'">'.
-      '</TD></TR>'."\n".
-      '<TR><TD><img src="white.png" height="'.$space['bottom'].'" width="1"></TD></TR>'."\n".
-      '</TABLE>'."\n";
+      '<img src="white.png" height="'.$height2.'" width=".'.$space['right'].'" />'.
+      '</td></tr>'."\n".
+      '<tr><td><img src="white.png" height="'.$space['bottom'].'" width="1"></td></tr>'."\n".
+      '</table>'."\n";
     //for ($i=0;$i<strlen($bars);$i+=2) print $line[$i]."<B>".$line[$i+1]."</B>&nbsp;";
     return $out;
 }
@@ -325,13 +309,13 @@
 function barcode_encode_genbarcode($code,$encoding){
     global $genbarcode_loc;
     /* delete EAN-13 checksum */
-    if (eregi("^ean$", $encoding) && strlen($code)==13) $code=substr($code,0,12);
+    if (preg_match("#^ean$#i", $encoding) && strlen($code)==13) $code=substr($code,0,12);
     if (!$encoding) $encoding="ANY";
-    $encoding=ereg_replace("[|\\]", "_", $encoding);
-    $code=ereg_replace("[|\\]", "_", $code);
-    $cmd=$genbarcode_loc." \""
-	.str_replace("\"", "\\\"",$code)."\" \""
-	.str_replace("\"", "\\\"",strtoupper($encoding))."\"";
+    $encoding=preg_replace("#[|\\\\]#", "_", $encoding);
+    $code=preg_replace("#[|\\\\]#", "_", $code);
+    $cmd=$genbarcode_loc." "
+	.escapeshellarg($code)." "
+	.escapeshellarg(strtoupper($encoding))."";
     //print "'$cmd'<BR>\n";
     $fp=popen($cmd, "r");
     if ($fp){
@@ -378,16 +362,16 @@
 function barcode_encode($code,$encoding){
     global $genbarcode_loc;
     if (
-		((eregi("^ean$", $encoding)
+		((preg_match("#^ean$#i", $encoding)
 		 && ( strlen($code)==12 || strlen($code)==13)))
 		 
-		|| (($encoding) && (eregi("^isbn$", $encoding))
+		|| (($encoding) && (preg_match("#^isbn$#i", $encoding))
 		 && (( strlen($code)==9 || strlen($code)==10) ||
-		 (((ereg("^978", $code) && strlen($code)==12) ||
+		 (((preg_match("#^978#", $code) && strlen($code)==12) ||
 		  (strlen($code)==13)))))
 
-		|| (( !isset($encoding) || !$encoding || (eregi("^ANY$", $encoding) ))
-		 && (ereg("^[0-9]{12,13}$", $code)))
+		|| (( !isset($encoding) || !$encoding || (preg_match("#^ANY$#i", $encoding) ))
+		 && (preg_match("#^[0-9]{12,13}$#", $code)))
 	      
 		){
 	/* use built-in EAN-Encoder */
@@ -397,15 +381,15 @@
 	$bars=barcode_encode_genbarcode($code, $encoding);
     } else {
 	print "php-barcode needs an external programm for encodings other then EAN/ISBN<BR>\n";
-	print "<UL>\n";
-	print "<LI>download gnu-barcode from <A href=\"http://www.gnu.org/software/barcode/\">www.gnu.org/software/barcode/</A>\n";
-	print "<LI>compile and install them\n";
-	print "<LI>download genbarcode from <A href=\"http://www.ashberg.de/bar/\">www.ashberg.de/bar/</A>\n";
-	print "<LI>compile and install them\n";
-	print "<LI>specify path the genbarcode in php-barcode.php\n";
-	print "</UL>\n";
-	print "<BR>\n";
-	print "<A HREF=\"http://www.ashberg.de/bar/\">Folke Ashberg's OpenSource PHP-Barcode</A><BR>\n";
+	print "<ul>\n";
+	print "<li>download gnu-barcode from <a href=\"http://www.gnu.org/software/barcode/\">www.gnu.org/software/barcode/</a></li>\n";
+	print "<li>compile and install them</li>\n";
+	print "<li>download genbarcode from <a href=\"http://www.ashberg.de/php-barcode/\">www.ashberg.de/php-barcode/</a></li>\n";
+	print "<li>compile and install them</li>\n";
+	print "<li>specify path to genbarcode in php-barcode.php</li>\n";
+	print "</ul>\n";
+	print "<br />\n";
+	print "<a href=\"http://www.ashberg.de/php-barcode/\">Folke Ashberg's OpenSource PHP-Barcode</a><br />\n";
 	return false;
     }
     return $bars;
@@ -426,8 +410,8 @@
     $bars=barcode_encode($code,$encoding);
     if (!$bars) return;
     if (!$mode) $mode="png";
-    if (eregi($mode,"^(text|txt|plain)$")) print barcode_outtext($bars['text'],$bars['bars']);
-    elseif (eregi($mode,"^(html|htm)$")) print barcode_outhtml($bars['text'],$bars['bars'], $scale,0, 0);
+    if (preg_match("#^(text|txt|plain)$#i", $mode)) print barcode_outtext($bars['text'],$bars['bars']);
+    elseif (preg_match("#^(html|htm)$#i", $mode)) print barcode_outhtml($bars['text'],$bars['bars'], $scale,0, 0);
     else barcode_outimage($bars['text'],$bars['bars'],$scale, $mode);
     return $bars;
 }
