Opened 20 years ago
Closed 20 years ago
#775 closed defect (fixed)
parseMetadataItem() is too sloppy about booleans
| Reported by: | Owned by: | ||
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | types | Version: | unspecified |
| Severity: | normal | Keywords: | |
| Cc: |
Description
In psLib rel12_0, the parser for boolean values accepts any string starting 'T' as true, and any string
starting 'F' as false (as well as 0/1); e.g. "TOTALLY_BOGUS" is parsed as true.
There is a status return for invalid keys, so it's simple to require that only the strings
T 1 TRUE (in any case combination) are true, and only
F 0 FALSE are false.
This is actually what the source code comment claims to be the case.
Note:
See TracTickets
for help on using tickets.

I changed the parser accordingly. It now accepts:
T, t, 1, TRUE, true, True
F, f, 0, FALSE, false, False
And rejects everything else.