From 50d44d335564bde433641bff6167a6d0353ced4f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zolt=C3=A1n=20Adamek?= <adamek.zoltan@gmail.com>
Date: Thu, 2 Feb 2012 22:49:30 +0100
Subject: [PATCH] Issue #1416218 by scorchio, tstoeckler: Improved variable
 naming in format_interval().

---
 includes/common.inc |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/includes/common.inc b/includes/common.inc
index e6fdca7..6c3e5c5 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -1293,7 +1293,7 @@ function format_size($size, $langcode = NULL) {
 /**
  * Format a time interval with the requested granularity.
  *
- * @param $timestamp
+ * @param interval
  *   The length of the interval in seconds.
  * @param $granularity
  *   How many different units to display in the string.
@@ -1303,14 +1303,14 @@ function format_size($size, $langcode = NULL) {
  * @return
  *   A translated string representation of the interval.
  */
-function format_interval($timestamp, $granularity = 2, $langcode = NULL) {
+function format_interval($interval, $granularity = 2, $langcode = NULL) {
   $units = array('1 year|@count years' => 31536000, '1 week|@count weeks' => 604800, '1 day|@count days' => 86400, '1 hour|@count hours' => 3600, '1 min|@count min' => 60, '1 sec|@count sec' => 1);
   $output = '';
   foreach ($units as $key => $value) {
     $key = explode('|', $key);
-    if ($timestamp >= $value) {
-      $output .= ($output ? ' ' : '') . format_plural(floor($timestamp / $value), $key[0], $key[1], array(), $langcode);
-      $timestamp %= $value;
+    if ($interval >= $value) {
+      $output .= ($output ? ' ' : '') . format_plural(floor($interval / $value), $key[0], $key[1], array(), $langcode);
+      $interval %= $value;
       $granularity--;
     }
 
-- 
1.7.5.4

