From 00666d4f25b967cef68c98b437eff267fa6731f7 Mon Sep 17 00:00:00 2001 From: moodler Date: Wed, 19 Jan 2005 12:12:34 +0000 Subject: [PATCH] Fixed bug 2040 relating to the last character being chopped off in the html2text conversion. While there I tidied up the source and fixed up a problem where the links were being printed BEFORE the text they refer to (now they are directly after) --- lib/html2text.php | 71 ++++++++++++++++++++++++++--------------------- 1 file changed, 40 insertions(+), 31 deletions(-) diff --git a/lib/html2text.php b/lib/html2text.php index e15a2d794d..55eaeb6457 100644 --- a/lib/html2text.php +++ b/lib/html2text.php @@ -23,16 +23,14 @@ function html2text( $badStr ) { $is_open_dq = false; $is_open_sq = false; - //remove PHP if it exists - - // while ( substr_count( $badStr, '<'.'?' ) && substr_count( $badStr, '?'.'>' ) && strpos( $badStr, '?'.'>', strpos( $badStr, '<'.'?' ) ) > strpos( $badStr, '<'.'?' ) ) { - // $badStr = substr( $badStr, 0, strpos( $badStr, '<'.'?' ) ) . substr( $badStr, strpos( $badStr, '?'.'>', strpos( $badStr, '<'.'?' ) ) + 2 ); - // } // Moodle - //remove comments - while ( substr_count( $badStr, '' ) && strpos( $badStr, '-->', strpos( $badStr, '', strpos( $badStr, '') && + strpos($badStr, '-->', strpos($badStr, '', + strpos( $badStr, '