Update of /cvsroot/php-blog/serendipity/plugins/serendipity_event_karma
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21462
Modified Files:
serendipity_event_karma.php
Log Message:
adjust url to not be sprintf()ed when %5D and other html entities are
transferred (like when in searching entries)
Index: serendipity_event_karma.php
===================================================================
RCS file: /cvsroot/php-blog/serendipity/plugins/serendipity_event_karma/serendipity_event_karma.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- serendipity_event_karma.php 9 Jun 2004 11:49:23 -0000 1.5
+++ serendipity_event_karma.php 14 Jun 2004 11:40:17 -0000 1.6
@@ -475,11 +475,11 @@
$url = $_SERVER['REQUEST_URI'] . (stristr($_SERVER['REQUEST_URI'], '?') ? '&' : '?');
$karma = (isset($serendipity['COOKIE']['karmaVote']) ? unserialize($serendipity['COOKIE']['karmaVote']) : array());
- $link_1 = '<a class="serendipity_karmaVoting_link1" href="#" onclick="javascript:location.href=\'' . $url . 'serendipity[karmaVote]=2&serendipity[karmaId]=%1$s#karma_vote%1$s\';" title="' . sprintf(PLUGIN_KARMA_RATE, PLUGIN_KARMA_VOTEPOINT_1) . '">++</a>';
- $link_2 = '<a class="serendipity_karmaVoting_link2" href="#" onclick="javascript:location.href=\'' . $url . 'serendipity[karmaVote]=1&serendipity[karmaId]=%1$s#karma_vote%1$s\';" title="' . sprintf(PLUGIN_KARMA_RATE, PLUGIN_KARMA_VOTEPOINT_2) . '">+</a>';
- $link_3 = '<a class="serendipity_karmaVoting_link3" href="#" onclick="javascript:location.href=\'' . $url . 'serendipity[karmaVote]=0&serendipity[karmaId]=%1$s#karma_vote%1$s\';" title="' . sprintf(PLUGIN_KARMA_RATE, PLUGIN_KARMA_VOTEPOINT_3) . '">0</a>';
- $link_4 = '<a class="serendipity_karmaVoting_link4" href="#" onclick="javascript:location.href=\'' . $url . 'serendipity[karmaVote]=-1&serendipity[karmaId]=%1$s#karma_vote%1$s\';" title="' . sprintf(PLUGIN_KARMA_RATE, PLUGIN_KARMA_VOTEPOINT_4) . '">-</a>';
- $link_5 = '<a class="serendipity_karmaVoting_link5" href="#" onclick="javascript:location.href=\'' . $url . 'serendipity[karmaVote]=-2&serendipity[karmaId]=%1$s#karma_vote%1$s\';" title="' . sprintf(PLUGIN_KARMA_RATE, PLUGIN_KARMA_VOTEPOINT_5) . '">--</a>';
+ $link_1 = '<a class="serendipity_karmaVoting_link1" href="#" onclick="javascript:location.href=\'%5$sserendipity[karmaVote]=2&serendipity[karmaId]=%1$s#karma_vote%1$s\';" title="' . sprintf(PLUGIN_KARMA_RATE, PLUGIN_KARMA_VOTEPOINT_1) . '">++</a>';
+ $link_2 = '<a class="serendipity_karmaVoting_link2" href="#" onclick="javascript:location.href=\'%5$sserendipity[karmaVote]=1&serendipity[karmaId]=%1$s#karma_vote%1$s\';" title="' . sprintf(PLUGIN_KARMA_RATE, PLUGIN_KARMA_VOTEPOINT_2) . '">+</a>';
+ $link_3 = '<a class="serendipity_karmaVoting_link3" href="#" onclick="javascript:location.href=\'%5$sserendipity[karmaVote]=0&serendipity[karmaId]=%1$s#karma_vote%1$s\';" title="' . sprintf(PLUGIN_KARMA_RATE, PLUGIN_KARMA_VOTEPOINT_3) . '">0</a>';
+ $link_4 = '<a class="serendipity_karmaVoting_link4" href="#" onclick="javascript:location.href=\'%5$sserendipity[karmaVote]=-1&serendipity[karmaId]=%1$s#karma_vote%1$s\';" title="' . sprintf(PLUGIN_KARMA_RATE, PLUGIN_KARMA_VOTEPOINT_4) . '">-</a>';
+ $link_5 = '<a class="serendipity_karmaVoting_link5" href="#" onclick="javascript:location.href=\'%5$sserendipity[karmaVote]=-2&serendipity[karmaId]=%1$s#karma_vote%1$s\';" title="' . sprintf(PLUGIN_KARMA_RATE, PLUGIN_KARMA_VOTEPOINT_5) . '">--</a>';
$karma_voting = '
<br /><div class="serendipity_karmaVoting"><a id="karma_vote%1$s"></a>
@@ -530,11 +530,11 @@
}
if (isset($karma[$entryid])) {
- $eventData[0]['extended'] .= sprintf($karma_current, $karma[$entryid], $row['points'], $row['votes'], $row['visits']);
+ $eventData[0]['extended'] .= sprintf($karma_current, $karma[$entryid], $row['points'], $row['votes'], $row['visits'], $url);
} elseif ($eventData[0]['timestamp'] < ($now - $max_karmatime)) {
- $eventData[0]['extended'] .= sprintf($karma_timeout, $entryid, $row['points'], $row['votes'], $row['visits']);
+ $eventData[0]['extended'] .= sprintf($karma_timeout, $entryid, $row['points'], $row['votes'], $row['visits'], $url);
} else {
- $eventData[0]['extended'] .= sprintf($karma_voting, $entryid, $row['points'], $row['votes'], $row['visits']);
+ $eventData[0]['extended'] .= sprintf($karma_voting, $entryid, $row['points'], $row['votes'], $row['visits'], $url);
}
} elseif (!$this->get_config('extended_only', false)) {
$elements = count($eventData);
@@ -565,11 +565,11 @@
$visits = (!empty($rows[$entryid]['visits']) ? $rows[$entryid]['visits'] : 0);
if (isset($karma[$entryid])) {
- $eventData[$i]['add_footer'] .= sprintf($karma_current, $karma[$entryid], $points, $votes, $visits);
+ $eventData[$i]['add_footer'] .= sprintf($karma_current, $karma[$entryid], $points, $votes, $visits, $url);
} elseif ($eventData[$i]['timestamp'] < ($now - $max_karmatime)) {
- $eventData[$i]['add_footer'] .= sprintf($karma_timeout, $entryid, $points, $votes, $visits);
+ $eventData[$i]['add_footer'] .= sprintf($karma_timeout, $entryid, $points, $votes, $visits, $url);
} else {
- $eventData[$i]['add_footer'] .= sprintf($karma_voting, $entryid, $points, $votes, $visits);
+ $eventData[$i]['add_footer'] .= sprintf($karma_voting, $entryid, $points, $votes, $visits, $url);
}
}
}
|