IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Opened 20 years ago

Closed 20 years ago

#775 closed defect (fixed)

parseMetadataItem() is too sloppy about booleans

Reported by: rhl@… Owned by: David.Robbins@…
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.

Change History (1)

comment:1 by David.Robbins@…, 20 years ago

Resolution: fixed
Status: newclosed

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

And rejects everything else.

Note: See TracTickets for help on using tickets.