aboutsummaryrefslogtreecommitdiffstats
path: root/debug_toolbar/middleware.py
diff options
context:
space:
mode:
authorLoic Bistuer2009-03-14 00:15:46 +0700
committerRob Hudson2009-03-21 09:18:09 -0700
commit4f680980f9987063c663e46ab190c7aeba552ac7 (patch)
tree85dbbb9107960a384ca19c642947743260f7e2a7 /debug_toolbar/middleware.py
parent8c64bb0cc82c6129b4ab14ff4cc80880761680d4 (diff)
downloaddjango-debug-toolbar-4f680980f9987063c663e46ab190c7aeba552ac7.tar.bz2
fixed bug when the string </body> matches more than once in the html
Signed-off-by: Rob Hudson <rob@cogit8.org>
Diffstat (limited to 'debug_toolbar/middleware.py')
-rw-r--r--debug_toolbar/middleware.py2
1 files changed, 1 insertions, 1 deletions
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