mangle @ in blockquote cite attribute

This commit is contained in:
Klaus Leithoff 2012-06-13 11:10:12 +00:00
parent 1d374636d4
commit 502a00e17f

View File

@ -114,6 +114,7 @@ class egw_htmLawed
* function to provide individual checks for element attribute pairs
* implemented so far: img checking for alt attribute == image; set this to empty
* a checking for title, replacing @
* blockquote checking for cite, replacing @
*/
function hl_my_tag_transform($element, $attribute_array=0)
{
@ -134,6 +135,13 @@ function hl_my_tag_transform($element, $attribute_array=0)
{
if (strpos($attribute_array['title'],'@')!==false) $attribute_array['title']=str_replace('@','(at)',$attribute_array['title']);
}
if ($element == 'blockquote')
{
if (isset($attribute_array['cite']))
{
if (strpos($attribute_array['cite'],'@')!==false) $attribute_array['cite']=str_replace('@','(at)',$attribute_array['cite']);
}
}
/*
// Elements other than 'span' or 'span' without a 'style' attribute are returned unchanged
if($element == 'span' && isset($attribute_array['style']))
@ -183,6 +191,7 @@ function hl_my_tag_transform($element, $attribute_array=0)
* -control for/on external Images and src-length
* a -checking for title and href, replacing @ accordingly
* -navigate to local anchors without reloading the page
* blockquote -checking for cite, replacing @
*/
function hl_email_tag_transform($element, $attribute_array=0)
{
@ -222,6 +231,13 @@ function hl_email_tag_transform($element, $attribute_array=0)
{
if (strpos($attribute_array['title'],'@')!==false) $attribute_array['title']=str_replace('@','(at)',$attribute_array['title']);
}
if ($element == 'blockquote')
{
if (isset($attribute_array['cite']))
{
if (strpos($attribute_array['cite'],'@')!==false) $attribute_array['cite']=str_replace('@','(at)',$attribute_array['cite']);
}
}
if($element == 'a')
{
if (isset($attribute_array['name']) && isset($attribute_array['id'])) $attribute_array['id'] = $attribute_array['name'];