Skip to content

Condition validation is not 100% correct #12

@johnnymast

Description

@johnnymast

Hi!,

While working on rivescript-php i was porting your checkSyntax function.

if ($line !~ /^.+?\s*(==|eq|!=|ne|<>|<|<=|>|>=)\s*.+?=>.+?$/) {
    return "Invalid format for !Condition: should be like `* value symbol value => response`";
}

This does not validate the usage of the == | != | ne | <> | < | <= | > | >= | characters.

The following script gets passed validation while the syntax of whats supposed to be eq male now says bleep male.

+ set gender
- <set gender=male>thank you

+ what is my gender
* <get gender> bleep male => You told me you were a boy.
* <get gender> eq female => You told me you were a girl.
- You never told me what you were.

I have tested this in the live testing environment as well and i didn't get any errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions