Project

General

Profile

Actions

Bug #15737

closed

Negative Ages (From timestamps in the future) get shown wrong

Added by Bernhard Kraft over 18 years ago. Updated over 18 years ago.

Status:
Closed
Priority:
Should have
Category:
Communication
Target version:
-
Start date:
2006-02-28
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.0
PHP Version:
4
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

There are two different methods used for calculating the age of a record. As the on in tslib_content always seems to get used for calculating a real age of a news record or something it seems it never has occured that somebody outputted the age of a timestamp which lies in the future.

There is a little difference between the method t3lib_BEfunc::calcAge and tslib_cObj->calcAge. The difference is that currently in the FE version no abs() is done and thus negative timestamps will always be lower than 3600 and the first if condition will always match.

Solution (would also be nice to use this on for the BE or have ONE SHARED method:
Make a variable which contains the absolute value of the seconds value.
Compare in which unit to display using the absolute value.
Generate the output using the original value (no need for a $prefix variable and string juggling)

A patch made against beta3 is attached.

(issue imported from #M2716)


Files

correct_negativeAge_2006-02-28.diff (716 Bytes) correct_negativeAge_2006-02-28.diff Administrator Admin, 2006-02-28 07:31

No data to display

Actions

Also available in: Atom PDF