Fixed a bug with 2 digit years
git-svn-id: file:///svn-source/pmgr/branches/v0.3_work/site@1003 97e9348a-65ac-dc4b-aefc-98561f571b83
This commit is contained in:
@@ -952,7 +952,9 @@ class AppController extends Controller {
|
|||||||
foreach ($searches AS &$search) {
|
foreach ($searches AS &$search) {
|
||||||
if (preg_match('/(_date|stamp)$/', $search['field']) &&
|
if (preg_match('/(_date|stamp)$/', $search['field']) &&
|
||||||
preg_match('%(\d{1,2})[-/](\d{1,2})[-/](\d{2,4})%', $search['value'], $matches)) {
|
preg_match('%(\d{1,2})[-/](\d{1,2})[-/](\d{2,4})%', $search['value'], $matches)) {
|
||||||
$search['value'] = sprintf('%04d%02d%02d', $matches[3], $matches[2], $matches[1]);
|
$search['value'] = sprintf('%04d%02d%02d',
|
||||||
|
$matches[3] + ($matches[3] < 50 ? 2000 : ($matches[3] < 100 ? 1900 : 0)),
|
||||||
|
$matches[2], $matches[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unset($search);
|
unset($search);
|
||||||
|
|||||||
Reference in New Issue
Block a user