Commit b7bf1ed6 authored by merlinofchaos's avatar merlinofchaos
Browse files

#122063: Prevent strtotime from choking on empty timestamps

parent 7e84d08b
...@@ -137,6 +137,7 @@ Views --dev ...@@ -137,6 +137,7 @@ Views --dev
o #118069: Move the query cache into the real cache. This should clear up a few caching problems. o #118069: Move the query cache into the real cache. This should clear up a few caching problems.
o #122818: Incorrect use of fullname when queryname should have been used o #122818: Incorrect use of fullname when queryname should have been used
o #108523: Properly validate that filter values need values selected. o #108523: Properly validate that filter values need values selected.
o #122063: Prevent strtotime from choking on empty timestamps
New features: New features:
o #105620: (Attempt 2) allow modules to alter views tables + arguments o #105620: (Attempt 2) allow modules to alter views tables + arguments
......
...@@ -1768,7 +1768,10 @@ function views_handler_field_filesize($fieldinfo, $fielddata, $value, $data) { ...@@ -1768,7 +1768,10 @@ function views_handler_field_filesize($fieldinfo, $fielddata, $value, $data) {
* Handle a timestamp filter. * Handle a timestamp filter.
*/ */
function views_handler_filter_timestamp($op, $filter, $filterinfo, &$query) { function views_handler_filter_timestamp($op, $filter, $filterinfo, &$query) {
$value = $filter['value'] == 'now' ? "***CURRENT_TIME***" : strtotime($filter['value']); $value = 0;
if ($filter['value']) {
$value = $filter['value'] == 'now' ? "***CURRENT_TIME***" : strtotime($filter['value']);
}
$table = $filterinfo['table']; $table = $filterinfo['table'];
$column = $filterinfo['field']; $column = $filterinfo['field'];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment