From 4f680980f9987063c663e46ab190c7aeba552ac7 Mon Sep 17 00:00:00 2001 From: Loic Bistuer Date: Sat, 14 Mar 2009 00:15:46 +0700 Subject: fixed bug when the string matches more than once in the html Signed-off-by: Rob Hudson --- debug_toolbar/middleware.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'debug_toolbar/middleware.py') diff --git a/debug_toolbar/middleware.py b/debug_toolbar/middleware.py index c3cf5f9..9c46079 100644 --- a/debug_toolbar/middleware.py +++ b/debug_toolbar/middleware.py @@ -19,7 +19,7 @@ def replace_insensitive(string, target, replacement): Code borrowed from: http://forums.devshed.com/python-programming-11/case-insensitive-string-replace-490921.html """ no_case = string.lower() - index = no_case.find(target.lower()) + index = no_case.rfind(target.lower()) if index >= 0: return string[:index] + replacement + string[index + len(target):] else: # no results so return the original string -- cgit v1.2.3