Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
wfpl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
15fa6e2
)
added enc_sql()
author
Jason Woofenden
<jason183@herkamire.com>
Mon, 25 Dec 2006 07:15:57 +0000
(
02:15
-0500)
committer
Jason Woofenden
<jason183@herkamire.com>
Mon, 25 Dec 2006 07:15:57 +0000
(
02:15
-0500)
encode.php
patch
|
blob
|
history
diff --git
a/encode.php
b/encode.php
index
c3c71a7
..
3a11689
100644
(file)
--- a/
encode.php
+++ b/
encode.php
@@
-22,6
+22,14
@@
# This file contains basic encodings
+# encode for putting within double-quotes in SQL
+function enc_sql($str) {
+ $str = str_replace("\\", "\\\\", $str);
+ $str = str_replace('"', "\\\"", $str);
+ return $str;
+}
+
+# encode for output in html. does nothing with whitespace
function enc_html($str) {
$str = str_replace('&', '&', $str);
$str = str_replace('<', '<', $str);