It looks like you check function's logic is wrong. Also you really don't need that else if() or even an else in that function, just return the proper value before the function ends.
By the way do you know that std::string has functions to find() if something exists in the string?