From 74847e2a59530fb4155eb87dc80b1a3bca63cc0e Mon Sep 17 00:00:00 2001 From: bwarsaw Date: Tue, 1 May 2001 06:00:38 +0000 Subject: QuoteHyperChars(): Porting forward from 2.0.4 a patch to get rid of the deprecated regsub so as to quiet a Python 2.1 warning. The standard cgi.escape() function does all this for us. --- Mailman/Utils.py | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'Mailman/Utils.py') diff --git a/Mailman/Utils.py b/Mailman/Utils.py index 890e284f5..0332aee61 100644 --- a/Mailman/Utils.py +++ b/Mailman/Utils.py @@ -27,8 +27,6 @@ import sys import os import string import re -# XXX: obsolete, should use re module -import regsub import random import urlparse import sha @@ -401,19 +399,8 @@ def CheckSiteAdminPassword(response): def QuoteHyperChars(str): - arr = regsub.splitx(str, '[<>"&]') - i = 1 - while i < len(arr): - if arr[i] == '<': - arr[i] = '<' - elif arr[i] == '>': - arr[i] = '>' - elif arr[i] == '"': - arr[i] = '"' - else: #if arr[i] == '&': - arr[i] = '&' - i = i + 2 - return string.join(arr, '') + from cgi import escape + return escape(str, quote=1) -- cgit v1.2.3-70-g09d2