return the uncleaned text if tidy isn't there or if nothing is returned
authorGabriel Wicke <gwicke@users.mediawiki.org>
Thu, 6 May 2004 13:38:23 +0000 (13:38 +0000)
committerGabriel Wicke <gwicke@users.mediawiki.org>
Thu, 6 May 2004 13:38:23 +0000 (13:38 +0000)
includes/Parser.php

index 5c88ba3..b39f704 100644 (file)
@@ -421,7 +421,11 @@ class Parser
                        fclose($pipes[1]);
                        $return_value = proc_close($process);
                }
-               return preg_replace("/(^.*<body[^>]*>|<\\/body[^>]*>.*$)/s", '', $cleansource);
+               if( $cleansource == '') {
+                       return $text;
+               } else {
+                       return preg_replace("/(^.*<body[^>]*>|<\\/body[^>]*>.*$)/s", '', $cleansource);
+               }
 
        }