mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Nicolas Capponi
22.40.2014 e70875a18cc560d7908f2230d302a032ff69fd17
OPENDJ-1591 GeneralizedTime parser accepts lowercase string

Update GeneralizedTime#valueOf to parse correctly a lowercase string
1 files modified
6 ■■■■ changed files
opendj-core/src/main/java/org/forgerock/opendj/ldap/GeneralizedTime.java 6 ●●●● patch | view | raw | blame | history
opendj-core/src/main/java/org/forgerock/opendj/ldap/GeneralizedTime.java
@@ -345,7 +345,8 @@
            break;
        case 'Z':
            // This is fine only if we are at the end of the value.
        case 'z':
                // This is fine only if we are at the end of the value.
            if (length == 11) {
                final TimeZone tz = TIME_ZONE_UTC_OBJ;
                return createTime(valueString, year, month, day, hour, minute, second, tz);
@@ -415,6 +416,7 @@
            break;
        case 'Z':
        case 'z':
            // This is fine only if we are at the end of the value.
            if (length == 13) {
                final TimeZone tz = TIME_ZONE_UTC_OBJ;
@@ -454,6 +456,7 @@
                    1000);
        case 'Z':
        case 'z':
            // This is fine only if we are at the end of the value.
            if (length == 15) {
                final TimeZone tz = TIME_ZONE_UTC_OBJ;
@@ -616,6 +619,7 @@
                break;
            case 'Z':
            case 'z':
                // This is only acceptable if we're at the end of the value.
                if (i != (value.length() - 1)) {
                    final LocalizableMessage message =