forked from expo/troggle
Changed regex for finding head and body of flat pages.
This commit is contained in:
parent
f527bd616a
commit
da3efb97ce
@ -15,7 +15,6 @@ import os
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
def flatpage(request, path):
|
def flatpage(request, path):
|
||||||
print "gggggg", path
|
|
||||||
try:
|
try:
|
||||||
r = Redirect.objects.get(originalURL = path)
|
r = Redirect.objects.get(originalURL = path)
|
||||||
return HttpResponseRedirect(r.newURL) # Redirect after POST
|
return HttpResponseRedirect(r.newURL) # Redirect after POST
|
||||||
@ -103,7 +102,7 @@ def editflatpage(request, path):
|
|||||||
except IOError:
|
except IOError:
|
||||||
raise Http404
|
raise Http404
|
||||||
html = o.read()
|
html = o.read()
|
||||||
m = re.search(r"<head>(.*)</head>.*<body>(.*)</body>", html, re.DOTALL)
|
m = re.search(r"<head>(.*)</head>.*<body[^>]*>(.*)</body>", html, re.DOTALL)
|
||||||
if m:
|
if m:
|
||||||
head, body = m.groups()
|
head, body = m.groups()
|
||||||
if re.search(r"iso-8859-1", html):
|
if re.search(r"iso-8859-1", html):
|
||||||
|
Loading…
Reference in New Issue
Block a user