User tests: Successful: Unsuccessful:
Pull Request for Issue #20905.
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$app->allowCache(true);
$doc->setModifiedDate('Wed, 17 Aug 2005 00:00:00 GMT');
Last-Modified: Wed, 17 Aug 2005 00:00:00 GMT
Last-Modified: Ср, 17 авг 2005 00:00:00
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
done
Pull request solves an Issue of incorrect sending of response header (Last-Modified)
Honestly either way works. The format()
method is already being told to format the Date
instance's timestamp in GMT, so it will always output a GMT time. Just a personal nitpick about arbitrarily printing "GMT" on its own outside the format()
method versus including it in the format()
method's output to begin with. The only way it would be problematic is if the timezone identifiers couldn't reliably output "GMT", in which case it's 100% right as is.
Labels |
Added:
?
Removed: ? |
Sorry that there were no responses for such a long time. Can you add the suggestion from Michael and update the test instructions so we can properly test it. In the meantime I'm closing the pr, when ready, please reopen again. Thanks for your help making Joomla better.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-03-25 18:01:15 |
Closed_By | ⇒ | laoneo |
Status | Closed | ⇒ | New |
Closed_Date | 2022-03-25 18:01:15 | ⇒ | |
Closed_By | laoneo | ⇒ |
Status | New | ⇒ | Pending |
I apologize, my impression was that this pr is not complete. Reopening again.
I have tested this item
I have tested this item
I've added the code snipped from the testing instructions (except of the first line because that was already there) to the index.php of the site template and inspected the response header in the browser's developer tools.
Without this PR applied it is "last-modified: Thu, 01 Jan 1970 00:00:00 GMT".
With this PR applied it is "last-modified: Wed, 17 Aug 2005 00:00:00 GMT".
I used Russian site language for the test.
So it seems the browser can't understand the Russian day and month names and so can't understand the time stamp and so sets it to zero = begin of epoch.
With the patch of this PR applied I get the expected value.
With the patch applied but without the code snippet from the testing instructions, everything works as well as before regarding the last-modified header.
Status | Pending | ⇒ | Ready to Commit |
RTC
Labels |
Added:
?
|
Will merge this here now. Thanks
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2022-04-30 07:09:15 |
Closed_By | ⇒ | zero-24 |
There was a reason you were asked to complete various sections when you submitted this. Please do so.