* Prevent naming properties with reserved words (Fix #16846) * Prevent using reserved constant names for properties or aliases * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * App: Add unit test for isTokenAConstant --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
This commit is contained in:
@@ -137,8 +137,9 @@ bool PropertySheet::isValidAlias(const std::string& candidate)
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Check to make sure it doesn't clash with a predefined unit */
|
||||
if (ExpressionParser::isTokenAUnit(candidate)) {
|
||||
/* Check to make sure it doesn't clash with a reserved name */
|
||||
if (ExpressionParser::isTokenAUnit(candidate)
|
||||
|| ExpressionParser::isTokenAConstant(candidate)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user