 	<cfset frm=frm & ", geog_search_term ">
 	<cfset whr=whr & " and geog_auth_rec.geog_auth_rec_id=geog_search_term.geog_auth_rec_id (+) ">
 	<cfset qual = "#qual# AND (
-			upper(geog_auth_rec.higher_geog) like '%#ucase(any_geog)#%' or
-			upper(geog_search_term.SEARCH_TERM) like '%#ucase(any_geog)#%'
+			upper(geog_auth_rec.higher_geog) like '%#ucase(escapeQuotes(any_geog))#%' or
+			upper(geog_search_term.SEARCH_TERM) like '%#ucase(escapeQuotes(any_geog))#%'
 	)">
 </cfif>
 <cfif isdefined("collecting_event_name") AND len(collecting_event_name) gt 0>
-	<cfset qual = "#qual# AND upper(collecting_event_name) like '%#ucase(collecting_event_name)#%'">
+	<cfset qual = "#qual# AND upper(collecting_event_name) like '%#ucase(escapeQuotes(collecting_event_name))#%'">
 </cfif>
 <cfif isdefined("VerificationStatus") AND len(#VerificationStatus#) gt 0>
-	<cfset qual = "#qual# AND VerificationStatus='#VerificationStatus#'">
+	<cfset qual = "#qual# AND VerificationStatus='#escapeQuotes(VerificationStatus)#'">
 </cfif>
 <cfif isdefined("georeference_protocol") AND len(#georeference_protocol#) gt 0>
-	<cfset qual = "#qual# AND georeference_protocol='#georeference_protocol#'">
+	<cfset qual = "#qual# AND georeference_protocol='#escapeQuotes(georeference_protocol)#'">
 </cfif>
 <cfif len(trim(qual)) is 0>
 	<cfset qual=" and 1=2">

	<cfset qual = "#qual# AND upper(spec_locality) like '%#escapeQuotes(ucase(spec_locality))#%'">
</cfif>
<cfif isdefined("maximum_elevation") and len(#maximum_elevation#) gt 0>
	<cfset qual = "#qual# AND maximum_elevation #maxElevOper# #maximum_elevation#">
</cfif>
<cfif isdefined("minimum_elevation") and len(#minimum_elevation#) gt 0>
	<cfset qual = "#qual# AND minimum_elevation #minElevOper# #minimum_elevation#">
</cfif>
<cfif isdefined("orig_elev_units") and len(#orig_elev_units#) gt 0>
	<cfset qual = "#qual# AND orig_elev_units = '#orig_elev_units#'">

	<cfset qual = "#qual# AND upper(verbatim_locality) like '%#escapeQuotes(ucase(verbatim_locality))#%'">
</cfif>
<cfif isdefined("coll_event_remarks") and len(#coll_event_remarks#) gt 0>
	<cfset qual = "#qual# AND upper(coll_event_remarks) like '%#ucase(escapeQuotes(coll_event_remarks))#%'">
</cfif>

<cfif isdefined("collecting_source") and len(#collecting_source#) gt 0>
	<cfset qual = "#qual# AND upper(collecting_source) like '%#ucase(escapeQuotes(collecting_source))#%'">
</cfif>

<cfif isdefined("collecting_method") and len(#collecting_method#) gt 0>
	<cfset qual = "#qual# AND upper(collecting_method) like '%#ucase(escapeQuotes(collecting_method))#%'">
</cfif>

<cfif isdefined("habitat") and len(habitat) gt 0>
	<cfset qual = "#qual# AND upper(habitat) like '%#ucase(escapeQuotes(habitat))#%'">
</cfif>
<cfif isdefined("locality_name") and len(locality_name) gt 0>
	<cfset qual = "#qual# AND upper(locality_name) like '%#escapeQuotes(ucase(locality_name))#%'">
