• rswindell's avatar
    Fix get_msg_header() problem reported by Bill McGarrity: · 4f279cb2
    rswindell authored
    "expand fields" could be misinterpretted (e.g. as 'false') if less than 3
    args were passed to the function. Apparently you can NOT assume that argv[argc]
    is undefined and would fail a JSVAL_IS_BOOLEAN test. In the reported problem,
    MsgBase.get_msg_header() was being called with 2 arguments (from newslink.js)
    and the if(JSVAL_IS_BOOLEAN(argv[n])) test, when n was 2, would eval to true
    and then argv[n] evalulated as false, which would cause a message with no
    message ID to not have one dynamically created, which would then cause the
    message to fail to post to an NNTP server due to malformed Message-ID (a
    missing message "id" property would end up being included in the newsgropu
    article header as "Message-ID: undefined").
    get_msg_index() had a similar potential issue, also fixed.