diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt
index 5628f3315..3f3fae37b 100644
--- a/docs/changelog/7.x.x.txt
+++ b/docs/changelog/7.x.x.txt
@@ -6,6 +6,7 @@
- Upgraded TinyMCE to 3.5.6
- fixed #12362: Thingy default Y/N field overly default
- fixed #12385: UTF-8 characters in Asset title break the Trash
+ - fixed ... and the same problem in the Clipboard
7.10.26
- fixed: Template diagnostics when called without a session asset.
diff --git a/lib/WebGUI/AssetClipboard.pm b/lib/WebGUI/AssetClipboard.pm
index 717e2974f..12316d137 100644
--- a/lib/WebGUI/AssetClipboard.pm
+++ b/lib/WebGUI/AssetClipboard.pm
@@ -662,22 +662,39 @@ sub www_manageClipboard {
assetManager.AddColumn('".$i18n->get("last updated")."','','center','');
assetManager.AddColumn('".$i18n->get("size")."','','right','');
\n";
- foreach my $child (@{$self->getAssetsInClipboard($limit)}) {
- my $title = $child->getTitle;
- my $plus = $child->getChildCount({includeTrash => 1}) ? "+ " : " ";
- $title =~ s/\'/\\\'/g;
- $output .= "assetManager.AddLine('"
- .WebGUI::Form::checkbox($self->session,{
- name=>'assetId',
- value=>$child->getId
- })
- ."','" . $plus . "getUrl("op=assetManager")."\">" . $title
- ."','
getIcon(1)."\" style=\"border-style:none;vertical-align:middle;\" alt=\"".$child->getName."\" />
".$child->getName
- ."','".$self->session->datetime->epochToHuman($child->get("revisionDate"))
- ."','".formatBytes($child->get("assetSize"))."');\n";
- $output .= "assetManager.AddLineSortData('','".$title."','".$child->getName
- ."','".$child->get("revisionDate")."','".$child->get("assetSize")."');\n";
- }
+ # To avoid string escaping issues
+ my $json = JSON->new->utf8(1);
+ my $amethod = sub {
+ my ($method, @args) = @_;
+ my $array = $json->encode(\@args);
+ $array =~ s/^\[//;
+ $array =~ s/\]$//;
+ $output .= "assetManager.$method($array);\n";
+ };
+ foreach my $child (@{$self->getAssetsInClipboard($limit)}) {
+ my $plus = $child->getChildCount({includeTrash => 1}) ? "+ " : " ";
+ my $title = $child->getTitle;
+ my $name = $child->getName;
+ $amethod->('AddLine',
+ WebGUI::Form::checkbox($self->session,{
+ name=>'assetId',
+ value=>$child->getId
+ }),
+ qq($plus$title),
+ '
+ .qq()
$name),
+ $self->session->datetime->epochToHuman($child->get("revisionDate")),
+ formatBytes($child->get("assetSize"))
+ );
+ $amethod->('AddLineSortData',
+ '',
+ $title,
+ $name,
+ $child->get('revisionDate'),
+ $child->get('assetSize'),
+ );
+ }
$output .= '
assetManager.AddButton("'.$i18n->get("delete").'","deleteList","manageClipboard");
assetManager.AddButton("'.$i18n->get("restore").'","restoreList","manageClipboard");