Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
wfpl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added enc_sql()
[wfpl.git]
/
encode.php
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
# 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);
function enc_html($str) {
$str = str_replace('&', '&', $str);
$str = str_replace('<', '<', $str);