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
fixed dwt_set() so you can call it multiple times with the same name
[wfpl.git]
/
db.php
diff --git
a/db.php
b/db.php
index
23c56b5
..
9390035
100644
(file)
--- a/
db.php
+++ b/
db.php
@@
-111,7
+111,6
@@
function db_printf($str) {
# This function does the work, but takes the parameters in an array
function _db_printf($str, $args) {
# This function does the work, but takes the parameters in an array
function _db_printf($str, $args) {
- $args = array_reverse($args); # because array_pop() takes from the end
$out = '';
while($str) {
$pos = strpos($str, '%');
$out = '';
while($str) {
$pos = strpos($str, '%');
@@
-129,11
+128,11
@@
function _db_printf($str, $args) {
$str = substr($str, $pos + 2);
if($chr == '"') {
$str = substr($str, $pos + 2);
if($chr == '"') {
- $out .= '"' . enc_sql(array_pop($args)) . '"';
+ $out .= '"' . enc_sql(array_shift($args)) . '"';
} elseif($chr == 's') {
} elseif($chr == 's') {
- $out .= enc_sql(array_pop($args));
+ $out .= enc_sql(array_shift($args));
} elseif($chr == 'i') {
} elseif($chr == 'i') {
- $int = format_int(array_pop($args));
+ $int = format_int(array_shift($args));
if($int == '') $int = '0';
$out .= $int;
} else {
if($int == '') $int = '0';
$out .= $int;
} else {