appdb/include db.php
WineHQ
wineowner at wine.codeweavers.com
Tue Jul 11 14:25:17 CDT 2006
ChangeSet ID: 26459
CVSROOT: /opt/cvs-commit
Module name: appdb
Changes by: wineowner at winehq.org 2006/07/11 14:25:16
Modified files:
include : db.php
Log message:
Chris Morgan <cmorgan at alum.wpi.edu>
Clean up variable naming in query_parameters()
Patch: http://cvs.winehq.org/patch.py?id=26459
Old revision New revision Changes Path
1.18 1.19 +16 -16 appdb/include/db.php
Index: appdb/include/db.php
diff -u -p appdb/include/db.php:1.18 appdb/include/db.php:1.19
--- appdb/include/db.php:1.18 11 Jul 2006 19:25:16 -0000
+++ appdb/include/db.php 11 Jul 2006 19:25:16 -0000
@@ -56,41 +56,41 @@ function query_parameters()
mysql_select_db(APPS_DB, $hAppdbLink);
}
- $data = func_get_args();
- $query = $data[0];
- $tokens = split("[&?~]", $query); /* NOTE: no need to escape characters inside of [] in regex */
- $preparedquery = $tokens[0];
- $count = strlen($tokens[0]);
+ $aData = func_get_args();
+ $sQuery = $aData[0];
+ $aTokens = split("[&?~]", $sQuery); /* NOTE: no need to escape characters inside of [] in regex */
+ $sPreparedquery = $aTokens[0];
+ $iCount = strlen($aTokens[0]);
/* do we have the correct number of tokens to the number of parameters provided? */
- if(count($tokens) != count($data))
+ if(count($aTokens) != count($aData))
return NULL; /* count mismatch, return NULL */
- for ($i=1; $i < count($tokens); $i++)
+ for ($i=1; $i < count($aTokens); $i++)
{
- $char = substr($query, $count, 1);
- $count += (strlen($tokens[$i])+1);
+ $char = substr($sQuery, $iCount, 1);
+ $iCount += (strlen($aTokens[$i])+1);
if ($char == "&")
{
- $fp = @fopen($data[$i], 'r');
+ $fp = @fopen($aData[$i], 'r');
$pdata = "";
if ($fp)
{
- while (($buf = fread($fp, 4096)) != false)
+ while (($sBuf = fread($fp, 4096)) != false)
{
- $pdata .= $buf;
+ $pdata .= $sBuf;
}
fclose($fp);
}
} else
{
- $pdata = &$data[$i];
+ $pdata = &$aData[$i];
}
- $preparedquery .= ($char != "~" ? mysql_real_escape_string($pdata) : $pdata);
- $preparedquery .= $tokens[$i];
+ $sPreparedquery .= ($char != "~" ? mysql_real_escape_string($pdata) : $pdata);
+ $sPreparedquery .= $aTokens[$i];
}
- return query_appdb($preparedquery);
+ return query_appdb($sPreparedquery);
}
function query_bugzilladb($sQuery,$sComment="")
More information about the wine-cvs
mailing list