cvs: pearweb /public_html/bugs/include functions.inc
| From: | Helgi �ormar �orbj�rnsson | Date: | Wed, 26 Mar 2008 21:38:55 +0000 |
| Subject: | cvs: pearweb /public_html/bugs/include functions.inc | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-7405@lists.php.net to get a copy of this message | ||
dufuz Wed Mar 26 21:38:55 2008 UTC
Modified files:
/pearweb/public_html/bugs/include functions.inc
Log:
made field() even smaller
getCol needs to be told which col to fetch via a param so that I can use the $param array
http://cvs.php.net/viewvc.cgi/pearweb/public_html/bugs/include/functions.inc?r1=1.171&r2=1.172&diff_format=u
Index: pearweb/public_html/bugs/include/functions.inc
diff -u pearweb/public_html/bugs/include/functions.inc:1.171
pearweb/public_html/bugs/include/functions.inc:1.172
--- pearweb/public_html/bugs/include/functions.inc:1.171 Wed Mar 26 20:53:30 2008
+++ pearweb/public_html/bugs/include/functions.inc Wed Mar 26 21:38:55 2008
@@ -15,7 +15,7 @@
* @package Bugs
* @copyright Copyright (c) 1997-2005 The PHP Group
* @license http://www.php.net/license/3_0.txt
PHP License
- * @version $Id: functions.inc,v 1.171 2008/03/26 20:53:30 dufuz Exp $
+ * @version $Id: functions.inc,v 1.172 2008/03/26 21:38:55 dufuz Exp $
*/
@@ -99,7 +99,7 @@
*
* @return string the sanitized string
*
- * @see escapeSQL(), field(), txfield()
+ * @see escapeSQL(), txfield()
*/
function clean($in)
{
@@ -117,7 +117,7 @@
*
* @return string|array the sanitized data
*
- * @see clean(), field(), txfield()
+ * @see clean(), txfield()
*/
function escapeSQL($in)
{
@@ -147,8 +147,7 @@
* @see clean(), escapeSQL(), txfield()
*/
function field($n) {
- $in = isset($_POST['in']) ? clean($_POST['in'][$n]) :
clean($GLOBALS['bug'][$n]);
- return $in;
+ return isset($_POST['in']) ? clean($_POST['in'][$n]) :
clean($GLOBALS['bug'][$n]);
}
/**
@@ -162,7 +161,7 @@
*
* @return mixed the data requested
*
- * @see clean(), escapeSQL(), field()
+ * @see clean(), escapeSQL()
*/
function txfield($n, $bug = null, $in = null)
{
@@ -445,7 +444,7 @@
SELECT name FROM packages
WHERE approved = 1 AND package_type = ?
ORDER BY name";
- $list = $dbh->getCol($sql, array(SITE));
+ $list = $dbh->getCol($sql, 'name', array(SITE));
foreach ($list as $name) {
$bug_items[$name] = $name;
}