[Zope-Checkins] CVS: Zope/lib/python/Products/ZCTextIndex - ZCTextIndex.py:1.30

Martijn Pieters mj@zope.com
Mon, 5 Aug 2002 17:28:14 -0400


Update of /cvs-repository/Zope/lib/python/Products/ZCTextIndex
In directory cvs.zope.org:/tmp/cvs-serv18674

Modified Files:
	ZCTextIndex.py 
Log Message:
As extra is no longer mandatory, grab the correct lexicon ID for the error message and in the process escape it so no HTML can be sneaked in.

=== Zope/lib/python/Products/ZCTextIndex/ZCTextIndex.py 1.29 => 1.30 ===
 
 """Plug in text index for ZCatalog with relevance ranking."""
 
+from cgi import escape
+
 import ZODB
 from Persistence import Persistent
 import Acquisition
@@ -71,7 +73,7 @@
         lexicon = getattr(caller, lexicon_id, None)
 
         if lexicon is None:
-            raise LookupError, 'Lexicon "%s" not found' % extra.lexicon_id
+            raise LookupError, 'Lexicon "%s" not found' % escape(lexicon_id)
 
         if not ILexicon.isImplementedBy(lexicon):
             raise ValueError, \