* dont restrict some chracters in tag names (/\<'>&")

This commit is contained in:
Max Pozdeev 2022-02-17 20:13:41 +03:00
parent 291708692b
commit 5b4253d6f0
3 changed files with 5 additions and 5 deletions

View file

@ -661,7 +661,7 @@ function prepareTags($tagsStr)
$aTags = array('tags'=>array(), 'ids'=>array());
foreach($tags as $tag)
{
$tag = str_replace(array('"',"'",'<','>','&','/','\\','^','#'),'',trim($tag));
$tag = str_replace(array('^','#'),'',trim($tag));
if($tag == '') continue;
$aTag = getOrCreateTag($tag);

View file

@ -24,8 +24,8 @@ function htmlarray_ref(&$a, $exclude=null)
foreach($a as $k=>$v)
{
if(is_array($v)) $a[$k] = htmlarray($v, $exclude);
elseif(!$exclude) $a[$k] = htmlspecialchars($v);
elseif(!in_array($k, $exclude)) $a[$k] = htmlspecialchars($v);
elseif(!$exclude) $a[$k] = htmlspecialchars($v ?? '');
elseif(!in_array($k, $exclude)) $a[$k] = htmlspecialchars($v ?? '');
}
return;
}

View file

@ -1593,7 +1593,7 @@ function editTask(id)
form.task.value = item.titleText;
form.note.value = item.noteText;
form.id.value = item.id;
form.tags.value = item.tags.split(',').join(', ');
form.tags.value = dehtml(item.tags).split(',').join(', ');
form.duedate.value = item.duedate;
form.prio.value = item.prio;
$('#taskedit_id').text('#' + item.id);
@ -2297,7 +2297,7 @@ function isParentId(el, id)
function dehtml(str)
{
return str.replace(/&quot;/g,'"').replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&amp;/g,'&');
return str.replace(/&quot;/g, '"').replace(/&#039;/g, "'").replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&amp;/g, '&');
};