Closed neclimdul closed 4 years ago
So PHP core has it wrong? Is there a bug report there?
looks like the d.o issue sugests: gm_date('D, d M Y H:i:s').' GMT', which is what Symfony currently does.
Yeah, this has the GMT inside the gm_date call and escaped rather then concatenated. Same code.
And re:php being wrong, sort of. RFC 2616 specifies dates be specified in a subset of the RFC1123 standard. The date must be in GMT and specifically with GMT as the timezone identifier. http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3
+1 for this cleanup. This has been fixed in D7 since Nov 2014.
Drupal 6 core has e.g.
header("Last-Modified: ". gmdate("D, d M Y H:i:s") ." GMT");
Though I agree the formatting doesn't really matter.
I'm also curious why this is using REQUEST_TIME
- that's just an optimization to avoid calling out to time()
?
I guess the $_SERVER['REQUEST_TIME']
part is another backport from D7, although it's really (int) $_SERVER['REQUEST_TIME']
.
No idea if PHP is really calling time() if you omit the 2nd argument, or if it has access to some internal pointer which directly gives you the time() value.
I guess there could be slight difference between the value of time() and REQUEST_TIME as well.
In any case, it can't make a huge difference, methinks.
Probably. We got strict about this in Drupal 7 and I assume David was following that here 586e6d9 when he added it.
I can't see a reason for this to still be open :)
Fixes #78