From: Dylan Lloyd Date: Tue, 8 Mar 2011 19:52:49 +0000 (-0500) Subject: Fixed /note/'s comment link logic X-Git-Url: https://disinclined.org/git/?a=commitdiff_plain;h=7a7a4e50628b1397204dfe1c3847aee0bda73a08;p=dylansserver.git Fixed /note/'s comment link logic --- 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 <<