Properly strip out HTML headers and footers from enscript.
authorJan Schneider <jan@horde.org>
Mon, 20 Apr 2009 21:32:20 +0000 (23:32 +0200)
committerJan Schneider <jan@horde.org>
Mon, 20 Apr 2009 21:32:35 +0000 (23:32 +0200)
framework/Mime/lib/Horde/Mime/Viewer/Enscript.php

index e8df9e2..3437a9f 100644 (file)
@@ -86,11 +86,9 @@ class Horde_Mime_Viewer_Enscript extends Horde_Mime_Viewer_Source
         $results = shell_exec($this->_conf['location'] . " -E$lang --language=html --color --output=- < $tmpin");
 
         /* Strip out the extraneous HTML from enscript. */
-        if ($inline) {
-            $res_arr = preg_split('/\<\/?pre\>/i', $results);
-            if (count($res_arr) == 3) {
-                $results = trim($res_arr[1]);
-            }
+        $res_arr = preg_split('/\<\/?pre\>/i', $results);
+        if (count($res_arr) == 3) {
+            $results = trim($res_arr[1]);
         }
 
         return $this->_lineNumber($results);