mirror of
https://github.com/gnustep/libs-gdl2.git
synced 2025-02-21 18:40:51 +00:00
* EOControl/EOPrivate.h/m (GDL2_isLegalDBName): New function.
* EOQualifier.m (getKey): Validate qualifier bind variable key. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@27923 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
68f788d944
commit
b991a133af
4 changed files with 40 additions and 2 deletions
|
@ -4,6 +4,9 @@
|
||||||
* EOAccess/GNUmakefile (EOGenericRecord): Build and install new
|
* EOAccess/GNUmakefile (EOGenericRecord): Build and install new
|
||||||
category.
|
category.
|
||||||
|
|
||||||
|
* EOControl/EOPrivate.h/m (GDL2_isLegalDBName): New function.
|
||||||
|
* EOQualifier.m (getKey): Validate qualifier bind variable key.
|
||||||
|
|
||||||
2009-02-18 David Ayers <ayers@fsfe.org>
|
2009-02-18 David Ayers <ayers@fsfe.org>
|
||||||
|
|
||||||
* configure.ac (disable-gui-projects): New option to disable builing
|
* configure.ac (disable-gui-projects): New option to disable builing
|
||||||
|
|
|
@ -362,7 +362,7 @@ GDL2CONTROL_EXPORT unsigned int EOMKKDInitializer_indexForKeyWithImpPtr(EOMKKDIn
|
||||||
// ==== EOEditingContext ====
|
// ==== EOEditingContext ====
|
||||||
|
|
||||||
GDL2CONTROL_EXPORT id EOEditingContext_objectForGlobalIDWithImpPtr(EOEditingContext* edContext,IMP* impPtr,EOGlobalID* gid);
|
GDL2CONTROL_EXPORT id EOEditingContext_objectForGlobalIDWithImpPtr(EOEditingContext* edContext,IMP* impPtr,EOGlobalID* gid);
|
||||||
EOGlobalID* EOEditingContext_globalIDForObjectWithImpPtr(EOEditingContext* edContext,IMP* impPtr,id object);
|
GDL2CONTROL_EXPORT EOGlobalID* EOEditingContext_globalIDForObjectWithImpPtr(EOEditingContext* edContext,IMP* impPtr,id object);
|
||||||
GDL2CONTROL_EXPORT id EOEditingContext_recordObjectGlobalIDWithImpPtr(EOEditingContext* edContext,IMP* impPtr,id object,EOGlobalID* gid);
|
GDL2CONTROL_EXPORT id EOEditingContext_recordObjectGlobalIDWithImpPtr(EOEditingContext* edContext,IMP* impPtr,id object,EOGlobalID* gid);
|
||||||
|
|
||||||
|
|
||||||
|
@ -371,6 +371,10 @@ GDL2CONTROL_EXPORT id EOEditingContext_recordObjectGlobalIDWithImpPtr(EOEditingC
|
||||||
GDL2CONTROL_EXPORT void EOHashAddTable(NSHashTable *to, NSHashTable *from);
|
GDL2CONTROL_EXPORT void EOHashAddTable(NSHashTable *to, NSHashTable *from);
|
||||||
|
|
||||||
|
|
||||||
|
// ==== hash convienience functions ====
|
||||||
|
|
||||||
|
GDL2CONTROL_EXPORT BOOL GDL2_isLegalDBName(NSString *name);
|
||||||
|
|
||||||
// ==== Memory Management Utilities ====
|
// ==== Memory Management Utilities ====
|
||||||
|
|
||||||
@interface NSObject (DeallocHack)
|
@interface NSObject (DeallocHack)
|
||||||
|
|
|
@ -642,3 +642,27 @@ static SEL eqSel;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
||||||
|
BOOL
|
||||||
|
GDL2_isLegalDBName(NSString* name)
|
||||||
|
{
|
||||||
|
static NSCharacterSet *illegalSet = nil;
|
||||||
|
NSRange range;
|
||||||
|
|
||||||
|
if (illegalSet == nil)
|
||||||
|
{
|
||||||
|
NSMutableCharacterSet *mutableSet;
|
||||||
|
illegalSet = [NSCharacterSet alphanumericCharacterSet];
|
||||||
|
mutableSet = AUTORELEASE([illegalSet mutableCopy]);
|
||||||
|
[mutableSet addCharactersInString:@"_-"];
|
||||||
|
illegalSet = RETAIN([mutableSet invertedSet]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (![name length])
|
||||||
|
{
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
range = [name rangeOfCharacterFromSet: illegalSet];
|
||||||
|
return (range.location == NSNotFound) ? YES : NO;
|
||||||
|
}
|
||||||
|
|
|
@ -508,6 +508,13 @@ getKey(const unichar **cFormat,
|
||||||
/* not sure about this !isQualVar */
|
/* not sure about this !isQualVar */
|
||||||
if (isQualVar)
|
if (isQualVar)
|
||||||
{
|
{
|
||||||
|
if (!GDL2_isLegalDBName(key))
|
||||||
|
{
|
||||||
|
NSString *format
|
||||||
|
= [NSString stringWithFormat: @"illegal qualifier variable $%@",key];
|
||||||
|
[NSException raise:NSInvalidArgumentException
|
||||||
|
format:format];
|
||||||
|
}
|
||||||
key = (id)[[EOQualifierVariable alloc] initWithKey:key];
|
key = (id)[[EOQualifierVariable alloc] initWithKey:key];
|
||||||
}
|
}
|
||||||
else if (isKeyValue)
|
else if (isKeyValue)
|
||||||
|
|
Loading…
Reference in a new issue