Dexels / navajo

Navajo Service-oriented Applications
GNU Affero General Public License v3.0
9 stars 5 forks source link

Expression parser discards everything after a non-opened closing parenthesis #419

Open kharybdys opened 7 years ago

kharybdys commented 7 years ago

Code snippet to replicate

    <map.navajomap>
        <navajomap.createproperty name="'/Input/MatchId'" value="[/MatchForm/MatchId]"/>
        <navajomap.callwebservice name="'external/mongo/competition/internal/ProcessQueryMongoMatch'"/>

        <param name="ACategory">
            <expression condition="$exists('/Match/ClassSeason/Class/isacategory')"
                        value=" $property('/Match/ClassSeason/Class/isacategory')) == '1'" />
            <expression condition="$exists('/Match/ClassSeason/CompetitionType/isacategory')"
                        value=" $property('/Match/ClassSeason/CompetitionType/isacategory')) == '1'" />
            <expression value="false" />
        </param>
    </map.navajomap>
-- This is a string (1 or 0), not a boolean as we'd expect
<debug value="'Value of ACategory: ' + [/@ACategory]"/> 

Preference is for the parser to crash with a "Malformed expression" type error

kharybdys commented 6 years ago

Actually, I'd also like the parser to crash with Malformed expression or somesuch for the following code snippet:

<debug value="'Rowcount: ' $rowCount"/>

Noticing you forgot the string concatenation (+) is actually pretty tricky.