diff --git a/Control/HTTPRequest.php b/Control/HTTPRequest.php index a7803b18b..17c9e77fd 100644 --- a/Control/HTTPRequest.php +++ b/Control/HTTPRequest.php @@ -439,7 +439,7 @@ class HTTPRequest implements ArrayAccess { $response = new HTTPResponse($fileData); $response->addHeader("Content-Type", "$mimeType; name=\"" . addslashes($fileName) . "\""); // Note a IE-only fix that inspects this header in HTTP::add_cache_headers(). - $response->addHeader("Content-Disposition", "attachment; filename=" . addslashes($fileName)); + $response->addHeader("Content-Disposition", "attachment; filename=\"" . addslashes($fileName) . "\""); $response->addHeader("Content-Length", strlen($fileData)); return $response; diff --git a/admin/code/ModelAdmin.php b/admin/code/ModelAdmin.php index 6ef876ba6..f8fef5239 100644 --- a/admin/code/ModelAdmin.php +++ b/admin/code/ModelAdmin.php @@ -17,6 +17,7 @@ use SilverStripe\Forms\HiddenField; use SilverStripe\Forms\FileField; use SilverStripe\Forms\LiteralField; use SilverStripe\Forms\CheckboxField; +use SilverStripe\Forms\DatetimeField; use SilverStripe\Forms\GridField\GridFieldExportButton; use SilverStripe\Forms\GridField\GridFieldConfig_RecordEditor; use SilverStripe\Forms\GridField\GridFieldPrintButton; @@ -247,6 +248,13 @@ abstract class ModelAdmin extends LeftAndMain { $params = ArrayLib::array_map_recursive('trim', $params); } + // Parse all DateFields to handle user input non ISO 8601 dates + foreach($context->getFields() as $field) { + if($field instanceof DatetimeField) { + $params[$field->getName()] = date('Y-m-d', strtotime($params[$field->getName()])); + } + } + $list = $context->getResults($params); $this->extend('updateList', $list); diff --git a/docs/en/02_Developer_Guides/05_Extending/index.md b/docs/en/02_Developer_Guides/05_Extending/index.md index 6cb8ba481..b038475e9 100644 --- a/docs/en/02_Developer_Guides/05_Extending/index.md +++ b/docs/en/02_Developer_Guides/05_Extending/index.md @@ -7,11 +7,11 @@ includes common functionality and default behaviors easily complemented with add themes. SilverStripe includes a myriad of extension API's such as *Extension Hooks* and support for programming patterns -such Dependency Injection. Allowing developers to tailor the framework to their needs without modifying the core +such as *Dependency Injection*. Allowing developers to tailor the framework to their needs without modifying the core framework. [CHILDREN Exclude="How_Tos"] ## How to's -[CHILDREN Folder="How_Tos"] \ No newline at end of file +[CHILDREN Folder="How_Tos"]