summaryrefslogtreecommitdiff
path: root/auto_prepend.php
diff options
context:
space:
mode:
authorChristian Schneider2007-11-09 15:16:24 +0000
committerChristian Schneider2007-11-09 15:16:24 +0000
commit0f3e763209348e6b1e34be71716029b8faaa0caf (patch)
tree4a5f80b53b026aec80d0b2193fae88b8db92fe3c /auto_prepend.php
parent1214316cbf8d2e9c71d445ddb83184316f568394 (diff)
downloaditools-0f3e763209348e6b1e34be71716029b8faaa0caf.tar.gz
itools-0f3e763209348e6b1e34be71716029b8faaa0caf.tar.bz2
itools-0f3e763209348e6b1e34be71716029b8faaa0caf.zip
Added experimental PHP taint support to ITools
Diffstat (limited to 'auto_prepend.php')
-rw-r--r--auto_prepend.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/auto_prepend.php b/auto_prepend.php
index 7d13289..192c743 100644
--- a/auto_prepend.php
+++ b/auto_prepend.php
@@ -149,4 +149,18 @@ function db_version()
return in_array("db4", dba_handlers()) ? "db4" : "db2";
}
+/**
+ * Experimental PHP taint support, see ftp://ftp.porcupine.org/pub/php/
+ */
+if (function_exists("taint"))
+{
+ function it_untaint(&$value, $marks = TC_HTML) { untaint($value, $marks); return $value; }
+ function it_taintcheck(&$value, $marks = TC_HTML) { if (istainted($value) & $marks) { untaint($value, $marks); it::error("it_taintcheck($value, $marks) failed"); } return $value; }
+}
+else
+{
+ function it_untaint(&$value, $marks = 0) { return $value; }
+ function it_taintcheck(&$value, $marks = 0) { }
+}
+
?>