From 7a7a4e50628b1397204dfe1c3847aee0bda73a08 Mon Sep 17 00:00:00 2001 From: Dylan Lloyd Date: Tue, 8 Mar 2011 14:52:49 -0500 Subject: [PATCH] Fixed /note/'s comment link logic --- index.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index e743a38..5bf04d6 100644 --- a/index.php +++ b/index.php @@ -304,7 +304,7 @@ class note extends cms { $this->comments_enabled = $comments_enabled; $url = htmlspecialchars($_SERVER['REQUEST_URI']); if (isset($_GET['verify'])) { - $url = substr($url, 0, (strlen($url)-7)); + $url = substr($url, 0, (strlen($url)-6)); } $this->url = $url; } @@ -389,7 +389,11 @@ END_OF_NAVIGATION; private function display_comment_link() { // somehow I should be checking if there are any first, // change to 'comment?' - $url = $this->url . 'comments/'; + if (substr($this->url, (strlen($this->url)-1), strlen($this->url)) == '/') { + $url = $this->url . 'comments/'; + } else { + $url = $this->url . '/comments/'; + } echo "comments"; } @@ -425,7 +429,7 @@ var RecaptchaOptions = { END_CAPTCHA_STYLE; require_once('includes/recaptchalib.php'); // Trailing slash is necessary for reloads to work - $url = $this->url . "verify/"; + $url = $this->url . "verify"; echo "
"; echo << -- 2.30.2