### Eclipse Workspace Patch 1.0
#P 19stable
Index: lib/html2text.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/html2text.php,v
retrieving revision 1.8.26.2
diff -u -r1.8.26.2 html2text.php
--- lib/html2text.php	26 Jul 2008 23:03:24 -0000	1.8.26.2
+++ lib/html2text.php	25 Feb 2009 00:30:48 -0000
@@ -17,7 +17,7 @@
 
   ********************************************************************/
 
-function html2text( $badStr ) {
+function html2text( $badStr) {
 
     $is_open_tb = false;
     $is_open_dq = false;
@@ -36,7 +36,9 @@
     //now make sure all HTML tags are correctly written (> not in between quotes)
 
     $len = strlen($badStr); // Moodle
-    $chr = $badStr{0}; // Moodle
+    if (!empty($badStr[0])) {
+        $chr = $badStr{0}; // Moodle
+    } else $chr = '';
     $goodStr = ''; // Moodle
 
     if ($len > 0) { // Moodle

