@@ -71,7 +71,7 @@ public function exportFolder(string $userId, int $folderId): string {
7171<TITLE>Bookmarks</TITLE> ' ;
7272
7373 $ file .= "<DL><p> \n" ;
74- $ file .= $ this ->serializeFolder ($ userId , $ folderId, true );
74+ $ file .= $ this ->serializeFolder ($ userId , $ folderId );
7575 $ file .= "</DL><p> \n" ;
7676
7777 return $ file ;
@@ -87,11 +87,12 @@ public function exportFolder(string $userId, int $folderId): string {
8787 * @throws UnauthorizedAccessError
8888 */
8989 protected function serializeFolder (string $ userId , int $ id , string $ indent = '' ): string {
90+ $ output = '' ;
9091 $ nextIndent = $ indent . ' ' ;
9192 $ childFolders = $ this ->treeMapper ->findChildren (TreeMapper::TYPE_FOLDER , $ id );
9293 foreach ($ childFolders as $ childFolder ) {
93- $ folder = $ this ->folderMapper ->find ($ id );
94- $ output = $ indent . '<DT><H3> ' . htmlspecialchars ($ folder ->getTitle ()) . '</H3> ' . "\n" ;
94+ $ folder = $ this ->folderMapper ->find ($ childFolder );
95+ $ output . = $ indent . '<DT><H3> ' . htmlspecialchars ($ folder ->getTitle ()) . '</H3> ' . "\n" ;
9596 $ output .= $ indent . '<DL><p> ' . "\n" . $ this ->serializeFolder ($ userId , $ childFolder ->getId (), $ nextIndent ) . '</DL><p> ' . "\n" ;
9697 }
9798
@@ -108,9 +109,6 @@ protected function serializeFolder(string $userId, int $id, string $indent = '')
108109 $ tags = Util::sanitizeHTML (implode (', ' , $ tags ));
109110 $ title = trim ($ bookmark ->getTitle ());
110111 $ url = Util::sanitizeHTML ($ bookmark ->getUrl ());
111- if ($ title === '' ) {
112- $ title = $ url ;
113- }
114112 $ title = Util::sanitizeHTML ($ title );
115113 $ description = Util::sanitizeHTML ($ bookmark ->getDescription ());
116114
0 commit comments