print ' Software Failure. Press left mouse button to continue.\n'
print msg_text
if msg_type == 'error':
- print ' Guru Meditation #DEADBEEF.ABADC0DE'
+ print '\n Guru Meditation #DEADBEEF.ABADC0DE'
print '</pre>'
# FIXME: This little JS snippet is harder to pass than ACID 3.0
print """
print '<hr /></div>'
+def send_httperror(status="403 Not Found", query=""):
+ print "Status: %s" % status
+ send_title(None, msg_text=("%s: on query '%s'" % (status, query)))
+ send_footer(None)
+
def link_tag(params, text=None, ss_class=None, privileged=False):
if text is None:
text = params # default
print "<p>%d hits out of %d pages searched.</p>" % (hits, searched)
def handle_raw(pagename):
+ if not file_re.match(pagename):
+ send_httperror("403 Forbidden", pagename)
+ return
+
Page(pagename).send_raw()
def handle_edit(pagename):
+ if not file_re.match(pagename):
+ send_httperror("403 Forbidden", pagename)
+ return
+
pg = Page(pagename)
if 'save' in form:
if form['file'].value:
else:
Page(query).format()
else:
- print "Status: 404 Not Found"
- send_title(None, msg_text='Can\'t work out query: ' + query)
- send_footer(None)
+ send_httperror("403 Forbidden", query)
except Exception:
import traceback
msg_text = traceback.format_exc()