function addTag(resource, type, endpoint)
{
if (!$('newtags-input_' + resource).value.blank()) {
- var params = { "params": "resource=" + resource + "/type=" + type + "/tags=" + $('newtags-input_' + resource).value };
+ var params = { "params": "resource=" + resource + "/type=" + type + "/tags=" + encodeURIComponent($('newtags-input_' + resource).value) };
new Ajax.Updater({success:'tags_' + resource},
endpoint + "/action=add/post=params",
{
$request = $args['action'];
$content = array('id' => $post['resource'], 'type' => $post['type']);
- $tags = $post['tags'];
+ $tags = rawurldecode($post['tags']);
// Check perms
if ($post['type'] == 'calendar') {
}
foreach ($tags as $tag_id => $tag) {
- $html .= '<li class="panel-tags">' . $tag . ($hasEdit ? '<a href="#" onclick="removeTag(\'' . $id . '\', \'' . $type . '\',' . $tag_id . ', \'' . Horde::url('imple.php', true) . '\'); Event.stop(event)" id="remove' . md5($id . $tag_id) . '">' . Horde::img('delete-small.png', _("Remove Tag"), '', $GLOBALS['registry']->getImageDir('horde')) . '</a>' : '') . '</li>';
+ $html .= '<li class="panel-tags">' . htmlspecialchars($tag) . ($hasEdit ? '<a href="#" onclick="removeTag(\'' . $id . '\', \'' . $type . '\',' . $tag_id . ', \'' . Horde::url('imple.php', true) . '\'); Event.stop(event)" id="remove' . md5($id . $tag_id) . '">' . Horde::img('delete-small.png', _("Remove Tag"), '', $GLOBALS['registry']->getImageDir('horde')) . '</a>' : '') . '</li>';
}
return $html;
}
// Tags.
- $this->tags = Horde_Util::getFormData('tags', $this->tags);
+ $this->tags = htmlspecialchars_decode(Horde_Util::getFormData('tags', $this->tags));
// Geolocation
$this->geoLocation = array('lat' => Horde_Util::getFormData('lat'),
</td>
<td colspan="4">
<input type="text" name="tags" id="tags" value="<?php echo (!empty($tags) ? htmlspecialchars($tags) : '')?>" size="40" />
- <div id="tags_results" name="tags_results" class="autocomplete"></div>
<span id="tags_loading_img" style="display:none;"><?php echo Horde::img('loading.gif', _("Loading...")) ?></span>
<?php $tac = Horde_Ajax_Imple::factory(array('kronolith', 'TagAutoCompleter'), array('triggerId' => 'tags', 'id' => $event->uid));
$tac->attach();
<?php foreach ($tags as $tag_id => $tag): ?>
<li class="panel-tags">
<?php
-echo $tag;
+echo htmlspecialchars($tag);
if ($cal->hasPermission(Horde_Auth::getAuth(), Horde_Perms::EDIT)) {
echo '<a href="#" id="remove' . md5($id . $tag_id) . '">'
. Horde::img('delete-small.png', _("Remove Tag"), '', $registry->getImageDir('horde'))
<td colspan="2" class="control"><strong><?php echo _("Tags")?></strong></td>
</tr>
<tr>
- <td colspan="2"><?php echo $tags?></td>
+ <td colspan="2"><?php echo htmlspecialchars($tags)?></td>
</tr>
<?php endif;?>