patch for htmlspaces

Mathieu Arnold arn_mat@club-internet.fr
Wed, 23 May 2001 17:56:59 +0200


here is a patch, to allow $text to be 0 (zero) because if $text = 0,
empty($text) is false....


Index: lib/base.php
===================================================================
RCS file: /home/cvs/cvs/dup/horde/chora/lib/base.php,v
retrieving revision 1.42
diff -u -r1.42 base.php
--- lib/base.php        2001/04/26 00:20:37     1.42
+++ lib/base.php        2001/05/23 15:54:58
@@ -242,12 +242,12 @@
   * @return The HTML-compliant converted text.  It always returns at
least
   *         a non-breakable space, if the return would otherwise be
empty.
   */
-function htmlspaces($text='') {
+function htmlspaces($text='  ') {
     $text = htmlentities($text);
     $text = str_replace("\t", '        ', $text);
     $text = str_replace('  ', '  ', $text);
     $text = str_replace('  ', '  ', $text);
-    return empty($text)?' ':$text;
+    return $text;
 }
 
 /**



-- 
Mathieu Arnold