Browse Source

Avoid E_NOTICE/E_WARNING message with files - refs BT#9325

Angel Fernando Quiroz Campos 10 years ago
parent
commit
08ca24da11
1 changed files with 5 additions and 5 deletions
  1. 5 5
      main/inc/ajax/admin.ajax.php

+ 5 - 5
main/inc/ajax/admin.ajax.php

@@ -62,18 +62,18 @@ switch ($action) {
         }
         }
 
 
         if (!is_dir($newUrlDir)) {
         if (!is_dir($newUrlDir)) {
-            mkdir($newUrlDir, api_get_permissions_for_new_directories(), true);
+            @mkdir($newUrlDir, api_get_permissions_for_new_directories(), true);
         }
         }
 
 
         $fullFilePath = "{$newUrlDir}{$blockId}_extra.html";
         $fullFilePath = "{$newUrlDir}{$blockId}_extra.html";
 
 
         if (file_exists($fullFilePath)) {
         if (file_exists($fullFilePath)) {
-            unlink($fullFilePath);
+            @unlink($fullFilePath);
         }
         }
 
 
-        touch($fullFilePath);
+        @touch($fullFilePath);
 
 
-        file_put_contents($fullFilePath, $content);
+        @file_put_contents($fullFilePath, $content);
 
 
         break;
         break;
 
 
@@ -100,7 +100,7 @@ switch ($action) {
             $newUrlDir = api_get_path(SYS_PATH) . "home/admin/";
             $newUrlDir = api_get_path(SYS_PATH) . "home/admin/";
         }
         }
 
 
-        echo file_get_contents("{$newUrlDir}{$blockId}_extra.html");
+        echo @file_get_contents("{$newUrlDir}{$blockId}_extra.html");
         break;
         break;
 }
 }