]> git.mjollnir.org Git - s9y.git/commitdiff
Fix ugly constant printing in templates, thanks to Sebastian for spotting.
authorgarvinhicking <garvinhicking>
Wed, 7 Sep 2005 12:56:16 +0000 (12:56 +0000)
committergarvinhicking <garvinhicking>
Wed, 7 Sep 2005 12:56:16 +0000 (12:56 +0000)
docs/NEWS
index.php

index 8867a61492590f7124cf222c57031e5143759828..291ca77c1e4dd17e46006f2157e150360e5779ae 100644 (file)
--- a/docs/NEWS
+++ b/docs/NEWS
@@ -3,6 +3,12 @@
 Version 0.9 ()
 ------------------------------------------------------------------------
 
+    * Fix "DATA_TRACKBACK_APPROVED" showing of constants when approving
+      trackbacks/comments instead of the properly formatted message.
+      (Would've required a template change for a "pretty solution", but
+       the current fix is a BC-compatible fix by defining constants a bit
+       differently) (garvinhicking)
+
     * Reduce memory usage by splitting up function files, optimizing
       spartacus parsing. New files:
         include/functions_rss.inc.php
index 20e50767a45739aa2006ef4c4ab5460ba4e0ba4c..94a73e7c169c41448329f810250463973ef9f87e 100644 (file)
--- a/index.php
+++ b/index.php
@@ -34,7 +34,7 @@ if (isset($_SERVER['HTTP_REFERER']) && empty($_SESSION['HTTP_REFERER'])) {
 
 if (preg_match(PAT_UNSUBSCRIBE, $uri, $res)) {
     if (serendipity_cancelSubscription(urldecode($res[1]), $res[2])) {
-        define('DATA_UNSUBSCRIBED', urldecode($res[1]));
+        define('DATA_UNSUBSCRIBED', sprintf(UNSUBSCRIBE_OK, urldecode($res[1])));
     }
 
     $uri = '/' . PATH_UNSUBSCRIBE . '/' . $res[2] . '-untitled.html';
@@ -44,9 +44,9 @@ if (preg_match(PAT_UNSUBSCRIBE, $uri, $res)) {
 
 if (preg_match(PAT_DELETE, $uri, $res) && $serendipity['serendipityAuthedUser'] === true) {
     if ($res[1] == 'comment' && serendipity_deleteComment($res[2], $res[3], 'comments')) {
-        define('DATA_COMMENT_DELETED', $res[2]);
+        define('DATA_COMMENT_DELETED', sprintf(COMMENT_DELETED, $res[2]));
     } elseif ( $res[1] == 'trackback' && serendipity_deleteComment($res[2], $res[3], 'trackbacks') ) {
-        define('DATA_TRACKBACK_DELETED', $res[2]);
+        define('DATA_TRACKBACK_DELETED', sprintf(TRACKBACK_DELETED, $res[2]));
     }
 } else {
     define('DATA_COMMENT_DELETED', false);
@@ -55,9 +55,11 @@ if (preg_match(PAT_DELETE, $uri, $res) && $serendipity['serendipityAuthedUser']
 
 if (preg_match(PAT_APPROVE, $uri, $res) && $serendipity['serendipityAuthedUser'] === true) {
     if ($res[1] == 'comment' && serendipity_approveComment($res[2], $res[3])) {
-        define('DATA_COMMENT_APPROVED', $res[2]);
+        define('DATA_COMMENT_APPROVED', sprintf(COMMENT_APPROVED, $res[2]));
+        define('DATA_TRACKBACK_APPROVED', false);
     } elseif ($res[1] == 'trackback' && serendipity_approveComment($res[2], $res[3])) {
-        define('DATA_TRACKBACK_APPROVED', $res[2]);
+        define('DATA_COMMENT_APPROVED', false);
+        define('DATA_TRACKBACK_APPROVED', sprintf(TRACKBACK_APPROVED, $res[2]));
     }
 } else {
     define('DATA_COMMENT_APPROVED', false);