X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=encode.php;h=11d60dbf62289ebb695a15e1bf7a6e86afee84f4;hb=95c7851dae93bd7429a262158a4cd7e9b33d51f7;hp=db0cde348dbcca0c48895bb1f067a3e1ae28e2ff;hpb=5ee58fc7dd8f44e53075e6898f89409c980ad34d;p=wfpl.git
diff --git a/encode.php b/encode.php
index db0cde3..11d60db 100644
--- a/encode.php
+++ b/encode.php
@@ -23,6 +23,10 @@
# will encode foo (using enc_html()) before displaying it, so that characters
# such as < will display properly.
+function enc_cap($str) {
+ $str = ucfirst($str);
+ return $str;
+}
function enc_jsdq($str) {
$str = enc_sql($str);
@@ -49,13 +53,24 @@ function enc_html($str) {
# Encode for output in html. Convert newlines to
#
-# Example:
~foo.html~
+# Example:~foo.htmlbr~
function enc_htmlbr($str) { $str = enc_html($str); $str = str_replace("\n", "~foo.htmlbrtab~
+function enc_htmlbrtab($str) { + $str = enc_htmlbr($str); + $space_to_nbsp = create_function('$matches', 'return str_repeat(\' \', strlen($matches[0]) * 2);'); + $str = preg_replace_callback("|^ *|m", $space_to_nbsp, $str); + return $str; +} + # Encode for output in html. Spaces converted to # # Example: