Commit 74579a7a authored by Jim Fulton's avatar Jim Fulton

Fixed bug in acquisition name check in cases where the name is not a string.

parent 74c40c12
......@@ -84,7 +84,7 @@
****************************************************************************/
static char cDocumentTemplate_module_documentation[] =
""
"\n$Id: cDocumentTemplate.c,v 1.23 1999/04/28 16:29:22 jim Exp $"
"\n$Id: cDocumentTemplate.c,v 1.24 1999/04/30 19:01:58 jim Exp $"
;
#include "ExtensionClass.h"
......@@ -866,12 +866,15 @@ validate(PyObject *self, PyObject *args)
UNLESS(PyArg_ParseTuple(args,"OOOOO",&inst,&parent,&name,&value,&md))
return NULL;
UNLESS(cname=PyString_AsString(name)) return NULL;
if (*cname=='a' && cname[1]=='q' && cname[2]=='_'
&& strcmp(cname, "aq_explicit") && strcmp(cname, "aq_parent"))
/* We disallow names beginning with "aq_" unless they are
aq_parent or aq_explicit */
return PyInt_FromLong(0);
if (PyString_Check(name))
{
UNLESS(cname=PyString_AsString(name)) return NULL;
if (*cname=='a' && cname[1]=='q' && cname[2]=='_'
&& strcmp(cname, "aq_explicit") && strcmp(cname, "aq_parent"))
/* We disallow names beginning with "aq_" unless they are
aq_parent or aq_explicit */
return PyInt_FromLong(0);
}
/*
if hasattr(value, '__roles__'): roles=value.__roles__
......@@ -1022,7 +1025,7 @@ void
initcDocumentTemplate()
{
PyObject *m, *d;
char *rev="$Revision: 1.23 $";
char *rev="$Revision: 1.24 $";
PURE_MIXIN_CLASS(cDocument,
"Base class for documents that adds fast validation method",
Document_methods);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment