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
db: use utf8 for client encoding, use real_escape
[wfpl.git]
/
encode.php
diff --git
a/encode.php
b/encode.php
index
c18f723
..
e79dae2
100644
(file)
--- a/
encode.php
+++ b/
encode.php
@@
-28,10
+28,18
@@
function enc_cap($str) {
return $str;
}
return $str;
}
+# quote for placing between single quotes in php
+function enc_phpsq($str) {
+ $str = str_replace("\\", "\\\\", $str);
+ $str = str_replace("'", "\\'", $str);
+ return $str;
+}
+
function enc_jsdq($str) {
$str = enc_sql($str);
$str = str_replace("\n", "\\n", $str);
function enc_jsdq($str) {
$str = enc_sql($str);
$str = str_replace("\n", "\\n", $str);
- return str_replace("\r", "\\r", $str);
+ $str = str_replace("\r", "\\r", $str);
+ return $str;
}
# encode for putting within double-quotes in SQL
}
# encode for putting within double-quotes in SQL
@@
-462,3
+470,12
@@
function enc_linkify($str) {
}
return $ret;
}
}
return $ret;
}
+
+# turns a filename into the unix timestamp of that files modification date
+function enc_mtime($dummy, $filename) {
+ $stat = stat($filename);
+ if ($stat === false) {
+ return '';
+ }
+ return '' . $stat['mtime'];
+}