User tests: Successful: Unsuccessful:
The Joomla\CMS\Document\Document
API supports setting a response's modified date, however this method is actually unused in core therefore nothing actually sets this to have found that it is broken. The Document API takes this value as a string, however the property it sets in Joomla\CMS\Application\WebApplication
is expected to be a Joomla\CMS\Date\Date
object. Using the current behavior, even if one were to call $document->setModifiedDate('2017-12-31');
the value would never be set as a response header because the web application validates the property is a Date object before processing it.
This PR addresses the type mismatching by documenting the $_mdate
property of the Document as supporting either a string or a Date object, converts the value to a Date object if it is a string before setting it to the application for use in the response headers, and changes the setModifiedDate()
method to type check and throw an Exception if an invalid type is given.
Code review as this code path is unused in core.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-02-07 00:31:12 |
Closed_By | ⇒ | zero-24 | |
Labels |
Added:
?
|
Merging on review. Thanks!