WM: add extra check for Python operator names

Check the "." separator isn't at the beginning/end of the string.
This commit is contained in:
Campbell Barton
2024-06-01 16:08:53 +10:00
parent 8c542ce15f
commit 5f5d851d13

View File

@@ -201,6 +201,15 @@ bool WM_operator_py_idname_ok_or_report(ReportList *reports,
/* Pass. */
}
else if (*ch == '.') {
if (ch == idname || (*(ch + 1) == '\0')) {
BKE_reportf(reports,
RPT_ERROR,
"Registering operator class: '%s', invalid bl_idname '%s', at position %d",
classname,
idname,
i);
return false;
}
dot++;
}
else {