aboutsummaryrefslogtreecommitdiff
path: root/views/default/output/confirmlink.php
diff options
context:
space:
mode:
Diffstat (limited to 'views/default/output/confirmlink.php')
-rw-r--r--views/default/output/confirmlink.php16
1 files changed, 14 insertions, 2 deletions
diff --git a/views/default/output/confirmlink.php b/views/default/output/confirmlink.php
index a51e58af9..0843083f0 100644
--- a/views/default/output/confirmlink.php
+++ b/views/default/output/confirmlink.php
@@ -19,6 +19,18 @@
$confirm = $vars['confirm'];
if (!$confirm)
- $confirm = elgg_echo('question:areyousure');
+ $confirm = elgg_echo('question:areyousure');
+
+ $link = $vars['href'];
+
+ if ($vars['is_action'])
+ {
+ $ts = time();
+ $token = generate_action_token($ts);
+
+ $sep = "?";
+ if (strpos($link, '?')>0) $sep = "&";
+ $link = "$link{$sep}__elgg_token=$token&__elgg_ts=$ts";
+ }
?>
-<a href="<?php echo $vars['href']; ?>" onclick="return confirm('<?php echo addslashes($confirm); ?>');"><?php echo htmlentities($vars['text'], ENT_QUOTES, 'UTF-8'); ?></a> \ No newline at end of file
+<a href="<?php echo $link; ?>" onclick="return confirm('<?php echo addslashes($confirm); ?>');"><?php echo htmlentities($vars['text'], ENT_QUOTES, 'UTF-8'); ?></a> \ No newline at end of file