Browse Source

Add condition to avoid fatal error see BT#7058

Julio Montoya 9 years ago
parent
commit
b61a6b8c8d
1 changed files with 20 additions and 6 deletions
  1. 20 6
      main/wiki/wiki.inc.php

+ 20 - 6
main/wiki/wiki.inc.php

@@ -5271,14 +5271,28 @@ class Wiki
                 api_replace_dangerous_char($data['reflink']),
                 'html'
             );
-            $convertedFile = $dataFileSystem->transcode($filePath, $format);
 
-            DocumentManager::file_send_for_download(
-                $convertedFile,
-                false,
-                $data['title'].'.'.$format
-            );
+            $try = true;
+
+            while ($try) {
+                try {
+                    $convertedFile = $dataFileSystem->transcode(
+                        $filePath,
+                        $format
+                    );
+
+                    $try = false;
+                    DocumentManager::file_send_for_download(
+                        $convertedFile,
+                        false,
+                        $data['title'].'.'.$format
+                    );
+                } catch (Exception $e) {
+
+                }
+            }
         }
+
         return false;
     }
 }