On Apr 2, 2008, at 11:16 PM, Lachlan Deck wrote:

Hi there,

If I have:
searchString  = '*' + input + '*';
new EOKeyValueQualifier( anAttribute, EOQualifier.QualifierOperatorCaseInsensitiveLike, searchString );

And someone puts in some strange characters (e.g., "find[me"), I get the following exception.

java.lang.IllegalArgumentException: Bad pattern *photogra[hy*for qualifier at com .webobjects .foundation ._NSStringUtilities ._bracketedStringFromPatternAnalyzer(_NSStringUtilities.java:740) at com .webobjects .foundation ._NSStringUtilities.stringMatchesPattern(_NSStringUtilities.java:785) at com .webobjects .eocontrol .EOKeyValueQualifier.evaluateWithObject(EOKeyValueQualifier.java:141) at com .webobjects .eocontrol.EOOrQualifier.evaluateWithObject(EOOrQualifier.java:103) at com .webobjects .eocontrol.EOAndQualifier.evaluateWithObject(EOAndQualifier.java:96) at com .webobjects .eocontrol.EOQualifier.filteredArrayWithQualifier(EOQualifier.java: 635)
        <...>

I thought EOF would escape things automatically, but perhaps there's a bug there(?). How else might I escape the chars (WO5.3.3)?


I think you have stumbled across an undocumented feature of CaseInsensitiveLike. I don't know what [...] might get interpreted as, but it seems to mean something. I don't know of any way to escape these magic characters in the qualifier value.

Chuck


--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects





_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to