diff --git a/main/inc/lib/fileUpload.lib.php b/main/inc/lib/fileUpload.lib.php
index 9337817abe..b22e80b8f1 100755
--- a/main/inc/lib/fileUpload.lib.php
+++ b/main/inc/lib/fileUpload.lib.php
@@ -1320,7 +1320,9 @@ function search_img_from_html($htmlFile)
{
$imgFilePath = array();
- $fp = fopen($htmlFile, "r") or die('
can not open file');
+ if(!$fp = fopen($htmlFile, "r")){ //or die('can not open file');
+ return ;
+ }
// search and store occurences of the tag in an array
$size_file=(filesize($htmlFile)===0) ? 1 : filesize($htmlFile);
@@ -1490,8 +1492,13 @@ function replace_img_path_in_html_file($originalImgPath, $newImgPath, $htmlFile)
/*
* Write the resulted new file
*/
- $fp = fopen($htmlFile, 'w') or die('cannot open file');
- fwrite($fp, $new_html_content) or die('cannot write in file');
+ if (!$fp = fopen($htmlFile, 'w')){ //or die('cannot open file');
+ return;
+ }
+
+ if (!fwrite($fp, $new_html_content)){ // or die('cannot write in file');
+ return;
+ }
}
//------------------------------------------------------------------------------