cvs: php-hosts-web /include shared.inc
| From: | jim winstead | Date: | Thu, 25 Apr 2002 01:31:21 +0000 |
| Subject: | cvs: php-hosts-web /include shared.inc | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-9848@lists.php.net to get a copy of this message | ||
jimw Wed Apr 24 21:31:21 2002 EDT
Modified files:
/php-hosts-web/include shared.inc
Log:
the usual helper functions
Index: php-hosts-web/include/shared.inc
diff -u php-hosts-web/include/shared.inc:1.9 php-hosts-web/include/shared.inc:1.10
--- php-hosts-web/include/shared.inc:1.9 Tue Apr 23 00:24:46 2002
+++ php-hosts-web/include/shared.inc Wed Apr 24 21:31:21 2002
@@ -124,4 +124,23 @@
return false;
}
+/* scrub user input so it can be re-output */
+function clean($in)
+{
+ return htmlentities(get_magic_quotes_gpc()?stripslashes($in):$in);
+}
+/* just rinse out any slashes. :) */
+function rinse($in)
+{
+ return get_magic_quotes_gpc()?stripslashes($in):$in;
+}
+
+/* handy function for when you're dealing with user input or a default. */
+function oneof()
+{
+ foreach (func_get_args() as $arg) {
+ if ($arg) return $arg;
+ }
+}
+
?>