X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=db.php;h=9390035af5044822004aa9195648dcaddd7b304d;hb=206f9ab762d9df2a262143dfa8b41f8ab3dfdcb0;hp=23c56b5ee57df8e01a05672de8b3b258db42be13;hpb=6e1e6239e46cb1c3059f4acd89cc53bf628cf99c;p=wfpl.git diff --git a/db.php b/db.php index 23c56b5..9390035 100644 --- 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) { - $args = array_reverse($args); # because array_pop() takes from the end $out = ''; while($str) { $pos = strpos($str, '%'); @@ -129,11 +128,11 @@ function _db_printf($str, $args) { $str = substr($str, $pos + 2); if($chr == '"') { - $out .= '"' . enc_sql(array_pop($args)) . '"'; + $out .= '"' . enc_sql(array_shift($args)) . '"'; } elseif($chr == 's') { - $out .= enc_sql(array_pop($args)); + $out .= enc_sql(array_shift($args)); } elseif($chr == 'i') { - $int = format_int(array_pop($args)); + $int = format_int(array_shift($args)); if($int == '') $int = '0'; $out .= $int; } else {