includes/wikiformat.php
changeset 1127 4b858862c35c
parent 1108 c1be67a50d81
child 1156 417e66a664d0
--- a/includes/wikiformat.php	Wed Sep 30 20:01:23 2009 -0400
+++ b/includes/wikiformat.php	Sun Oct 04 03:59:38 2009 -0400
@@ -152,7 +152,14 @@
       }
       
       // execute rule
+      $text_before = $text;
       $text = $this->perform_render_step($text, $rule, $parser, $renderer);
+      if ( empty($text) )
+      {
+        trigger_error("Wikitext was empty after rule \"$rule\"; restoring backup", E_USER_WARNING);
+        $text = $text_before;
+      }
+      unset($text_before);
       
       // run posthooks
       foreach ( $this->hooks as $hook )