summaryrefslogtreecommitdiffstats
path: root/lib.php
diff options
context:
space:
mode:
authorRomain d'Alverny <rda@mageia.org>2012-09-09 22:01:39 +0000
committerRomain d'Alverny <rda@mageia.org>2012-09-09 22:01:39 +0000
commitc18473f9b74747b692bf356888811c69841602ad (patch)
tree65e01297c5001101ba3c5cc42e39702ed267be22 /lib.php
parent1e02e816c6ff4ea9f655511652ce76ff5b64f49c (diff)
downloadpkgsubmit-c18473f9b74747b692bf356888811c69841602ad.tar
pkgsubmit-c18473f9b74747b692bf356888811c69841602ad.tar.gz
pkgsubmit-c18473f9b74747b692bf356888811c69841602ad.tar.bz2
pkgsubmit-c18473f9b74747b692bf356888811c69841602ad.tar.xz
pkgsubmit-c18473f9b74747b692bf356888811c69841602ad.zip
fix warnings (undeclared/unset vars)
Diffstat (limited to 'lib.php')
-rw-r--r--lib.php29
1 files changed, 18 insertions, 11 deletions
diff --git a/lib.php b/lib.php
index dc5b378..5f4f559 100644
--- a/lib.php
+++ b/lib.php
@@ -67,17 +67,20 @@ function get_refined_packages_list($list_of_files, $package = null, $user = null
continue;
}
$key = $val[6] . $val[7];
- if (!is_array($pkgs[$key])) {
+ if (!array_key_exists($key, $pkgs)) {
$pkgs[$key] = array(
- 'status' => array(),
- 'path' => $val[2],
- 'version' => $val[3],
- 'media' => $val[4],
- 'section' => $val[5],
- 'user' => $val[7],
- 'host' => $val[8],
- 'job' => $val[9]
+ 'status' => array(),
+ 'path' => $val[2],
+ 'version' => $val[3],
+ 'media' => $val[4],
+ 'section' => $val[5],
+ 'user' => $val[7],
+ 'host' => $val[8],
+ 'job' => $val[9],
+ 'revision' => '',
+ 'summary' => '',
+ 'package' => ''
);
}
$status = $val[1];
@@ -217,7 +220,7 @@ function key2timestamp($key) {
*
* @return string
*/
-function timediff($start, $end)
+function timediff($start, $end = null)
{
if (is_null($end)) {
$end = time();
@@ -467,7 +470,11 @@ S;
} else {
$d = explode(' ', $duration);
if ($d[0] > 20) {
- $newdata['21 minutes'] += $count;
+ if (!array_key_exists('21 minutes', $newdata)) {
+ $newdata['21 minutes'] = $count;
+ } else {
+ $newdata['21 minutes'] += $count;
+ }
} else {
$newdata[$duration] = $count;
}