diff --git a/inc/inc.ClassUI.php b/inc/inc.ClassUI.php
index 15f82a25a..fe9d76283 100644
--- a/inc/inc.ClassUI.php
+++ b/inc/inc.ClassUI.php
@@ -688,7 +688,7 @@ class UI {
if ($folderID != $currentFolderID){
if ($navigation) print "";
- else print "getName(), ENT_QUOTES) . "')\">";
+ else print "getName()) . "')\">";
}else print "";
diff --git a/out/out.DocumentChooser.php b/out/out.DocumentChooser.php
index 7c9ff496f..8f92b3ef5 100644
--- a/out/out.DocumentChooser.php
+++ b/out/out.DocumentChooser.php
@@ -87,7 +87,7 @@ function printTree($path, $level = 0)
for ($i = 0; $i < count($documents); $i++) {
print "\n";
print "
";
- print "getID().",'".htmlspecialchars($documents[$i]->getName(), ENT_QUOTES)."');\">
".htmlspecialchars($documents[$i]->getName())."";
+ print "getID().",'".str_replace("'", "\\'", $documents[$i]->getName())."');\">
".htmlspecialchars($documents[$i]->getName())."";
print "";
}