Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There is logic in the handling of image assets for the various apps (screenshots, icons) that currently depends on the last-modified header from the webserver that might not be present (http://tools.ietf.org/html/rfc2616) in all cases. There is currently an error thrown #1763394: Notice: Undefined index: last-modified in apps_retrieve_app_image when it isn't supported.
Comment | File | Size | Author |
---|---|---|---|
#4 | 1790902.4-check-last-modified-existing.patch | 702 bytes | mrfelton |
#1 | 1790902-check-last-modified-existing.patch | 1 KB | populist |
Comments
Comment #1
populist CreditAttribution: populist commentedThis patch will do a simple check to see if the last-modified value exists before doing checking against it. It also changes and documents the conditional logic so the "file" is altered if either information (last-modified or content-length) exists but is different than the original file.
Comment #2
elliotttf CreditAttribution: elliotttf commentedIs there a chance that
$remote['last-modified']
could legitimately be 0 (not necessarily intentionally, but perhaps due to server misconfiguration, etc) in which caseisset()
should be used in favor ofempty()
?That edge case aside this change makes sense and looks good to me.
Comment #3
populist CreditAttribution: populist commented@elliotttf - It is not possible for last-modified to be legitimately zero since the spec requires an HTTP-date (http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1) which cannot be zero.
Comment #4
mrfelton CreditAttribution: mrfelton commentedSame patch, updated to apply against latest codebase
Comment #5
mrfelton CreditAttribution: mrfelton commentedLeaving as RTBC, since this is just a straight reroll.
Comment #6
hefox CreditAttribution: hefox commentedThat wasn't the straightiest of rerolls, populist have you tested it?
Comment #7
hefox CreditAttribution: hefox commentedSeemed safe enough