diff --git a/blogthon.cgi b/blogthon.cgi
index 56a9335..bcb0db1 100755
--- a/blogthon.cgi
+++ b/blogthon.cgi
@@ -106,14 +106,20 @@ try:
except ConfigParser.Error, error:
errorpage(str(error))
+if not re.match("^http:\/\/.*$", blog_url):
+ blog_url = "http://" + blog_url
+
+if not re.match("^.*\/$", blog_url):
+ blog_url = blog_url + "/"
+
if not os.path.exists(entries_dir):
- errorpage("Directory \"" + entries_dir + "\" does not exist!")
+ errorpage("Directory \"%s\" does not exist!" % entries_dir)
if not os.path.exists(staticpages_dir):
- errorpage("Directory \"" + staticpages_dir + "\" does not exist!")
+ errorpage("Directory \"%s\" does not exist!" % staticpages_dir)
if not os.path.exists(plugins_dir):
- errorpage("Directory \"" + plugins_dir + "\" does not exist!")
+ errorpage("Directory \"%s\" does not exist!" % plugins_dir)
if not os.path.exists("linklist"):
errorpage("File \"linklist\" does not exist!")
@@ -206,7 +212,7 @@ if cname and ctext and ctitle:
content = open(comments_file, "w")
content.close()
except:
- errorpage("\"" + entries_dir + "\" isn\'t writable!")
+ errorpage("\"%s\" isn\'t writable!" % entries_dir)
try:
content = open(comments_file, "a")
@@ -219,7 +225,7 @@ if cname and ctext and ctitle:
# Send mail?
if not new_comment_mail == "False":
- msg = "From: Blogthon\nTo: " + mail_to + "\nSubject: New comment on " + blog_title + "\n\nSomeone wrote a comment to this entry: " + blog_url + "?p=" + ctitle.replace(" ", "-")
+ msg = "From: Blogthon\nTo: %s\nSubject: New comment on %s\n\nSomeone wrote a comment to this entry: %s?p=%s" % (mail_to, blog_title, blog_url, ctitle.replace(" ", "-"))
smtp = SMTP(smtp_host)
smtp.starttls()
smtp.sendmail(blog_title, mail_to, msg)
@@ -267,13 +273,13 @@ if feed_display == "atom":
sec = "%(#)02d" % {"#": int(date[5])}
document_header("atom")
- print ""
+ print "" % blog_url
print tab + "
" for line in content: @@ -484,10 +490,10 @@ else: content = open(entry, "r") print tab*3 + "