diff options
author | Seth Mos <seth.mos@dds.nl> | 2012-02-15 07:42:31 -0800 |
---|---|---|
committer | Seth Mos <seth.mos@dds.nl> | 2012-02-15 07:42:31 -0800 |
commit | e32805d9ef2e06f61c4f7146e69800f2014eb8e4 (patch) | |
tree | e53cd2f6dcdf5801f171a812322fd1b14671b084 /usr | |
parent | 37129ab8f85a1ec4d79422b7d3439284e05f6d61 (diff) | |
parent | 4d148b596e8fa30df5cdf615518482c1ee30f735 (diff) | |
download | pfsense-e32805d9ef2e06f61c4f7146e69800f2014eb8e4.zip pfsense-e32805d9ef2e06f61c4f7146e69800f2014eb8e4.tar.gz |
Merge pull request #49 from yakatz/master
2038 bug in user manager
Diffstat (limited to 'usr')
-rw-r--r-- | usr/local/www/system_usermanager.php | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/usr/local/www/system_usermanager.php b/usr/local/www/system_usermanager.php index 07a0241..2051a60 100644 --- a/usr/local/www/system_usermanager.php +++ b/usr/local/www/system_usermanager.php @@ -231,22 +231,18 @@ if ($_POST) { /* * Check for a valid expirationdate if one is set at all (valid means, - * strtotime() puts out a time stamp so any strtotime compatible time + * DateTime puts out a time stamp so any DateTime compatible time * format may be used. to keep it simple for the enduser, we only * claim to accept MM/DD/YYYY as inputs. Advanced users may use inputs * like "+1 day", which will be converted to MM/DD/YYYY based on "now". * Otherwhise such an entry would lead to an invalid expiration data. */ if ($_POST['expires']){ - if(strtotime($_POST['expires']) > 0){ - if (strtotime("-1 day") > strtotime(date("m/d/Y",strtotime($_POST['expires'])))) { - // Allow items to lie in the past which ends up disabling. - } else { - //convert from any strtotime compatible date to MM/DD/YYYY - $expdate = strtotime($_POST['expires']); - $_POST['expires'] = date("m/d/Y",$expdate); - } - } else { + try { + $expdate = new DateTime($_POST['expires']); + //convert from any DateTime compatible date to MM/DD/YYYY + $_POST['expires'] = $expdate->format("m/d/Y"); + } catch ( Exception $ex ) { $input_errors[] = gettext("Invalid expiration date format; use MM/DD/YYYY instead."); } } |