Fixed tags with quotes killing the Javascript
Of course not.
This commit is contained in:
parent
7be1f9e637
commit
8c5987a6b2
@ -93,33 +93,34 @@ class TagEditCloud extends Extension {
|
|||||||
|
|
||||||
$counter = 1;
|
$counter = 1;
|
||||||
foreach($tag_data as $row) {
|
foreach($tag_data as $row) {
|
||||||
if(class_exists("TagCategories")){
|
|
||||||
$full_tag = $row['tag'];
|
$full_tag = $row['tag'];
|
||||||
$tc = explode(':',$full_tag);
|
|
||||||
|
if(class_exists("TagCategories")){
|
||||||
|
$tc = explode(':',$row['tag']);
|
||||||
if(isset($tc[1]) && isset($cat_color[$tc[0]])){
|
if(isset($tc[1]) && isset($cat_color[$tc[0]])){
|
||||||
$h_tag = html_escape($tc[1]);
|
$h_tag = html_escape($tc[1]);
|
||||||
$color = '; color:'.$cat_color[$tc[0]];
|
$color = '; color:'.$cat_color[$tc[0]];
|
||||||
} else {
|
} else {
|
||||||
$h_tag = html_escape($full_tag);
|
$h_tag = html_escape($row['tag']);
|
||||||
$color = '';
|
$color = '';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$full_tag = $row['tag'];
|
$h_tag = html_escape($row['tag']);
|
||||||
$h_tag = html_escape($full_tag);
|
|
||||||
$color = '';
|
$color = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$size = sprintf("%.2f", max($row['scaled'],0.5));
|
$size = sprintf("%.2f", max($row['scaled'],0.5));
|
||||||
|
$js = htmlspecialchars('tageditcloud_toggle_tag(this,'.json_encode($full_tag).')',ENT_QUOTES); //Ugly, but it works
|
||||||
|
|
||||||
if(array_search($row['tag'],$image->tag_array) !== FALSE) {
|
if(array_search($row['tag'],$image->tag_array) !== FALSE) {
|
||||||
if($used_first) {
|
if($used_first) {
|
||||||
$precloud .= " <span onclick='tageditcloud_toggle_tag(this,\"$full_tag\")' class='tag-selected' style='font-size: ${size}em$color' title='${row['count']}'>$h_tag</span> \n";
|
$precloud .= " <span onclick='$js' class='tag-selected' style='font-size: ${size}em$color' title='${row['count']}'>$h_tag</span> \n";
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
$entry = " <span onclick='tageditcloud_toggle_tag(this,\"$full_tag\")' class='tag-selected' style='font-size: ${size}em$color' title='${row['count']}'>$h_tag</span> \n";
|
$entry = " <span onclick='$js' class='tag-selected' style='font-size: ${size}em$color' title='${row['count']}'>$h_tag</span> \n";
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$entry = " <span onclick='tageditcloud_toggle_tag(this,\"$full_tag\")' style='font-size: ${size}em$color' title='${row['count']}'>$h_tag</span> \n";
|
$entry = " <span onclick='$js' style='font-size: ${size}em$color' title='${row['count']}'>$h_tag</span> \n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if($counter++ <= $def_count) {
|
if($counter++ <= $def_count) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user