cvs: php-gtk-web /include shared-manual.inc
| From: | James Moore | Date: | Sat, 01 Sep 2001 18:56:56 +0000 |
| Subject: | cvs: php-gtk-web /include shared-manual.inc | ||
| Groups: | php.gtk.webmaster | ||
| Request: | Send a blank email to php-gtk-webmaster+get-23@lists.php.net to get a copy of this message | ||
jmoore Sat Sep 1 14:56:56 2001 EDT
Modified files:
/php-gtk-web/include shared-manual.inc
Log:
- Add the dehtmlspecialchars function that allows us
to hightlight_string the code in exmaples using a very
big hack.
# The reason for this is that the XSLT spec doesnt seem to
# allow the escaping of special chars so I have done the following
# Turn output buffering on
# output example code
# get contents of output buffer
# destroy output buffer
# Turn > et all back into their respective charecters
# hightlight & output the contents of the output buffer
Index: php-gtk-web/include/shared-manual.inc
diff -u php-gtk-web/include/shared-manual.inc:1.44 php-gtk-web/include/shared-manual.inc:1.45
--- php-gtk-web/include/shared-manual.inc:1.44 Sat Aug 11 09:42:34 2001
+++ php-gtk-web/include/shared-manual.inc Sat Sep 1 14:56:56 2001
@@ -430,3 +430,14 @@
}
+function dehtmlspecialchars($str)
+{
+
+ $str = preg_replace("%>%",">",$str);
+ $str = preg_replace("%<%","<",$str);
+ $str = preg_replace("%"%","\"",$str);
+ $str = preg_replace("%&%","&",$str);
+
+ return $str;
+
+}